1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 11:07:45 +00:00

Chess: Don't ask the engine to make a move if the game is finished

Previously, the engine would attempt to make a move if the engine was
changed after the game had ended.

This change also allows the player to always flip the board when the
game is finished, instead of only being able to flip the board on
their turn.
This commit is contained in:
Tim Ledbetter 2023-05-20 22:33:15 +01:00 committed by Jelle Raaijmakers
parent 8ce1b7ab7e
commit 5a25082be5

View file

@ -448,7 +448,7 @@ bool ChessWidget::want_engine_move()
{ {
if (!m_engine) if (!m_engine)
return false; return false;
if (board().turn() == side()) if (board().turn() == side() || board().game_finished())
return false; return false;
return true; return true;
} }