[gnome-chess] Fix broken Undo in most CECP engines
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-chess] Fix broken Undo in most CECP engines
- Date: Sun, 28 Jul 2013 02:20:38 +0000 (UTC)
commit 22ff8b13bc3d52df15d4d4e1838724b24101a5c9
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 22b28b6..2eb1881 100644
--- a/src/chess-engine-cecp.vala
+++ b/src/chess-engine-cecp.vala
@@ -101,6 +101,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]