summaryrefslogtreecommitdiff
path: root/chess-engine.el
diff options
context:
space:
mode:
Diffstat (limited to 'chess-engine.el')
-rw-r--r--chess-engine.el5
1 files changed, 5 insertions, 0 deletions
diff --git a/chess-engine.el b/chess-engine.el
index 83416514..5c556aa 100644
--- a/chess-engine.el
+++ b/chess-engine.el
@@ -62,6 +62,11 @@
(let ((chess-engine-handling-event t))
(cond
((eq event 'move)
+ ;; if the game index is still 0, then our opponent is white, and
+ ;; we need to pass over the move
+ (if (= (chess-game-index (chess-engine-game nil)) 0)
+ (chess-game-run-hooks (chess-engine-game nil) 'pass))
+
(let ((ply (chess-algebraic-to-ply (chess-engine-position nil)
(car args))))
(if ply