summaryrefslogtreecommitdiff
path: root/chess-none.el
diff options
context:
space:
mode:
Diffstat (limited to 'chess-none.el')
-rw-r--r--chess-none.el15
1 files changed, 8 insertions, 7 deletions
diff --git a/chess-none.el b/chess-none.el
index 104d524..e5004ef 100644
--- a/chess-none.el
+++ b/chess-none.el
@@ -6,19 +6,20 @@
(require 'chess-engine)
-(defun chess-none-handler (event &rest args)
+(defun chess-none-handler (game event &rest args)
"An empty chess engine, used for fielding key events.
This is only useful when two humans are playing each other, in which
case this engine will do the job of accepting undos, handling
resignations, etc."
- (cond
- ((eq event 'initialize) t)
+ (unless chess-engine-handling-event
+ (cond
+ ((eq event 'initialize) t)
- ((memq event '(resign abort))
- (chess-engine-set-position nil))
+ ((memq event '(resign abort))
+ (chess-engine-set-position nil))
- ((eq event 'undo)
- (chess-game-undo chess-engine-game (car args)))))
+ ((eq event 'undo)
+ (chess-game-undo game (car args))))))
(provide 'chess-none)