diff options
Diffstat (limited to 'Libraries/LibChess/Chess.cpp')
-rw-r--r-- | Libraries/LibChess/Chess.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Libraries/LibChess/Chess.cpp b/Libraries/LibChess/Chess.cpp index 28249c6956..7495acf0fb 100644 --- a/Libraries/LibChess/Chess.cpp +++ b/Libraries/LibChess/Chess.cpp @@ -385,10 +385,13 @@ bool Board::apply_illegal_move(const Move& move, Colour colour) { Board clone = *this; clone.m_previous_states = {}; + clone.m_moves = {}; auto state_count = 0; if (m_previous_states.contains(clone)) state_count = m_previous_states.get(clone).value(); + m_previous_states.set(clone, state_count + 1); + m_moves.append(move); m_turn = opposing_colour(colour); |