summaryrefslogtreecommitdiff
path: root/chess-common.el
diff options
context:
space:
mode:
Diffstat (limited to 'chess-common.el')
-rw-r--r--chess-common.el12
1 files changed, 7 insertions, 5 deletions
diff --git a/chess-common.el b/chess-common.el
index 7f32eb4..2c590a6 100644
--- a/chess-common.el
+++ b/chess-common.el
@@ -64,10 +64,7 @@
((eq event 'draw)
(chess-message 'draw-offer-declined))
- ((eq event 'drawn)
- (chess-game-set-data game 'active nil))
-
- ((memq event '(resign abort new))
+ ((eq event 'new)
(chess-engine-send nil "new\n")
(chess-engine-set-position nil))
@@ -86,7 +83,12 @@
(chess-game-set-tag game "White" chess-full-name)
(chess-game-set-tag game "Black" chess-engine-opponent-name))
- (chess-engine-send nil (concat (chess-ply-to-algebraic (car args)) "\n"))
+ (cond
+ ((chess-ply-keyword (car args) :resign)
+ (chess-engine-send nil "resign\n"))
+ (t
+ (chess-engine-send nil (concat (chess-ply-to-algebraic (car args))
+ "\n"))))
(if (chess-game-over-p game)
(chess-game-set-data game 'active nil)))))