[gnome-chess] Disconnect engine timeout check when game ends



commit 937006aff3014a168724874e92e67ad8195c70db
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Sun Dec 6 10:25:53 2020 -0600

    Disconnect engine timeout check when game ends
    
    Oops, this is a regression from 5ca2ab04. We don't want to complain that
    the engine has not moved if the game is over....

 src/gnome-chess.vala | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/src/gnome-chess.vala b/src/gnome-chess.vala
index 03c8d5d..be7c826 100644
--- a/src/gnome-chess.vala
+++ b/src/gnome-chess.vala
@@ -1172,6 +1172,9 @@ Copyright © 2015–2016 Sahil Sareen""";
             engine_timeout_source = 0;
         }
 
+        if (!game.is_started)
+            return;
+
         if (pgn_game.white_ai != null && game.current_player.color == Color.WHITE ||
             pgn_game.black_ai != null && game.current_player.color == Color.BLACK)
         {
@@ -1517,6 +1520,7 @@ Copyright © 2015–2016 Sahil Sareen""";
         }
 
         update_game_status (what, why);
+        update_engine_timeout ();
 
         white_time_label.queue_draw ();
         black_time_label.queue_draw ();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]