summaryrefslogtreecommitdiff
path: root/chess-common.el
diff options
context:
space:
mode:
Diffstat (limited to 'chess-common.el')
-rw-r--r--chess-common.el13
1 files changed, 6 insertions, 7 deletions
diff --git a/chess-common.el b/chess-common.el
index ce320b4..4fc26f6 100644
--- a/chess-common.el
+++ b/chess-common.el
@@ -66,6 +66,10 @@
((eq event 'draw)
(chess-message 'draw-offer-declined))
+ ((eq event 'resign)
+ (chess-engine-send nil "resign\n")
+ (chess-game-set-data game 'active nil))
+
((eq event 'new)
(chess-engine-send nil "new\n")
(chess-engine-set-position nil))
@@ -93,13 +97,8 @@
(chess-game-set-tag game "White" chess-full-name)
(chess-game-set-tag game "Black" chess-engine-opponent-name))
- (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"))))
-
+ (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)))))