summaryrefslogtreecommitdiff
path: root/chess-game.el
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2002-04-15 00:58:29 +0000
committerJohn Wiegley <johnw@newartisans.com>2002-04-15 00:58:29 +0000
commit7365cd3c961dece991bc67017afcc917359be69a (patch)
treef8ad41f8fc7d508a6c3b2324a184b91b0bdea65c /chess-game.el
parente15c5ad70e32debce094a3c53caf875afb648338 (diff)
*** no comment ***
Diffstat (limited to 'chess-game.el')
-rw-r--r--chess-game.el15
1 files changed, 10 insertions, 5 deletions
diff --git a/chess-game.el b/chess-game.el
index c3d281a..9832372 100644
--- a/chess-game.el
+++ b/chess-game.el
@@ -59,8 +59,9 @@ matches."
(defsubst chess-game-run-hooks (game &rest args)
"Return the tags alist associated with GAME."
(unless chess-game-inhibit-events
- (dolist (hook (chess-game-hooks game))
- (apply (car hook) game (cdr hook) args))))
+ (let (result)
+ (dolist (hook (chess-game-hooks game) result)
+ (setq result (apply (car hook) game (cdr hook) args))))))
(defsubst chess-game-tags (game)
@@ -142,9 +143,12 @@ matches."
"Return the GAME's current position index."
(1- (length (chess-game-plies game))))
-(defsubst chess-game-seq (game)
+(defun chess-game-seq (game)
"Return the current GAME sequence."
- (1+ (/ (chess-game-index game) 2)))
+ (let ((index (chess-game-index game)))
+ (if (> index 1)
+ (/ index 2)
+ (1+ (/ index 2)))))
(defsubst chess-game-side-to-move (game)
(chess-pos-side-to-move (chess-game-pos game)))
@@ -230,7 +234,8 @@ progress (nil), if it is drawn, resigned, mate, etc."
(chess-game-run-hooks game 'move current-ply))))
(t
- (chess-game-run-hooks game 'move current-ply)))))
+ (chess-game-run-hooks game 'move current-ply)
+ (chess-game-run-hooks game 'post-move)))))
(defsubst chess-game-end (game keyword)
"End the current game, by resignation, draw, etc."