diff options
author | Tim Ledbetter <timledbetter@gmail.com> | 2023-05-20 22:33:15 +0100 |
---|---|---|
committer | Jelle Raaijmakers <jelle@gmta.nl> | 2023-05-23 11:43:22 +0200 |
commit | 5a25082be5c166fba83161673ffafc555e0c15da (patch) | |
tree | 277cec12726124a8239c3bf4b5bcf1dfffea8b9a | |
parent | 8ce1b7ab7e7e0b86653175b594c02b095c8668cf (diff) | |
download | serenity-5a25082be5c166fba83161673ffafc555e0c15da.zip |
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.
-rw-r--r-- | Userland/Games/Chess/ChessWidget.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Games/Chess/ChessWidget.cpp b/Userland/Games/Chess/ChessWidget.cpp index aeb952c79e..b8342d37b7 100644 --- a/Userland/Games/Chess/ChessWidget.cpp +++ b/Userland/Games/Chess/ChessWidget.cpp @@ -448,7 +448,7 @@ bool ChessWidget::want_engine_move() { if (!m_engine) return false; - if (board().turn() == side()) + if (board().turn() == side() || board().game_finished()) return false; return true; } |