[gnome-chess/gnome-3-8] Fix broken Undo in most CECP engines



commit 7d5c67ea048d011562ad1ea47d10f43fdbc6d7f0
Author: Michael Catanzaro <mike catanzaro gmail com>
Date:   Sat Jul 27 21:17:50 2013 -0500

    Fix broken Undo in most CECP engines
    
    https://bugzilla.gnome.org/show_bug.cgi?id=704993

 src/chess-engine-cecp.vala |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/chess-engine-cecp.vala b/src/chess-engine-cecp.vala
index 4a7aff5..42d6852 100644
--- a/src/chess-engine-cecp.vala
+++ b/src/chess-engine-cecp.vala
@@ -89,6 +89,16 @@ public class ChessEngineCECP : ChessEngine
 
     public override void undo ()
     {
+        /*
+         * We're undoing only the most recent move here, so there's no need to
+         * call Undo twice, or to use fanciness like the remove command. This
+         * function will be called twice if we need to undo two moves in a row.
+         *
+         * force is not necessary for GNUChess or Phalanx, but it's required by
+         * CECP and most other engines will move again immediately without it
+         * (leading to an apparent AI hang).
+         */
+        write_line ("force");
         write_line ("undo");
     }
 }


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