[gnome-chess/gnome-3-10] Fix CECP checkmate processing



commit bec662a1e4d020fc3c96a86d07050931dd133d9c
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Sun Oct 13 13:28:58 2013 -0500

    Fix CECP checkmate processing
    
    This was just flatly wrong. It's not an error to say the game is over.

 src/chess-engine-cecp.vala |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/chess-engine-cecp.vala b/src/chess-engine-cecp.vala
index 55162bd..ee19571 100644
--- a/src/chess-engine-cecp.vala
+++ b/src/chess-engine-cecp.vala
@@ -70,12 +70,16 @@ public class ChessEngineCECP : ChessEngine
             {
                 resigned ();
             }
-            else if (line.has_prefix ("Illegal move: ") ||
-                     line.has_prefix ("1-0") || line.has_prefix ("0-1"))
+            else if (line.has_prefix ("Illegal move: "))
             {
                 stop ();
                 error ();
             }
+            else if (line.has_prefix ("1-0") || line.has_prefix ("0-1"))
+            {
+                /* The engine thinks the game is over and will not play on. */
+                stop ();
+            }
             else if (line == "game is a draw" ||
                      line == "draw" ||
                      line == "Draw" ||


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