From 5a25082be5c166fba83161673ffafc555e0c15da Mon Sep 17 00:00:00 2001 From: Tim Ledbetter Date: Sat, 20 May 2023 22:33:15 +0100 Subject: [PATCH] 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. --- Userland/Games/Chess/ChessWidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }