summaryrefslogtreecommitdiff
path: root/chess-clock.el
diff options
context:
space:
mode:
Diffstat (limited to 'chess-clock.el')
-rw-r--r--chess-clock.el13
1 files changed, 6 insertions, 7 deletions
diff --git a/chess-clock.el b/chess-clock.el
index 8913908..cbb5c37 100644
--- a/chess-clock.el
+++ b/chess-clock.el
@@ -58,17 +58,16 @@
(run-with-timer 0 1 'chess-clock-tick-tock (current-buffer))))
(let ((last-ply (car (last (chess-game-plies game) 2))))
(chess-ply-set-keyword last-ply :white white)
- (chess-ply-set-keyword last-ply :black black)))))
+ (chess-ply-set-keyword last-ply :black black))))
+
+ (if (and chess-clock-timer (chess-game-over-p game))
+ (cancel-timer chess-clock-timer)
+ (setq chess-clock-timer nil)))
((eq event 'set-data)
(if (and (eq (car args) 'active)
(not (chess-game-data game 'active)))
- (chess-clock-handler game 'destroy)))
-
- ((memq event '(destroy resign drawn))
- (when chess-clock-timer
- (cancel-timer chess-clock-timer)
- (setq chess-clock-timer nil)))))
+ (chess-clock-handler game 'destroy)))))
(defvar chess-clock-tick-tocking nil)