diff options
| -rw-r--r-- | PLAN | 1 | ||||
| -rw-r--r-- | chess-ics.el | 25 |
2 files changed, 13 insertions, 13 deletions
@@ -7,6 +7,7 @@ chess-pos chess-ics - detect draw/resign/abort/retract, etc. - add support for ICS observing +- set the "Site" tag after logging in chess-clock - when a clock runs down, indicate this in the modeline, and allow the diff --git a/chess-ics.el b/chess-ics.el index 6de470a..39bae50 100644 --- a/chess-ics.el +++ b/chess-ics.el @@ -160,26 +160,25 @@ who is black." (let ((chess-engine-handling-event t) (begin (match-beginning 0)) (end (match-end 0)) - (info (chess-ics12-parse (match-string 1)))) - (if (and (chess-game-data (chess-engine-game nil) 'active) - (> (chess-engine-index nil) 0)) + (info (chess-ics12-parse (match-string 1))) + (game (chess-engine-game nil))) + (if (chess-game-data game 'active) (when (and (cadr info) (eq (chess-pos-side-to-move (car info)) - (chess-game-data (chess-engine-game nil) 'my-color))) - (let* ((game (chess-engine-game nil)) - (ply (chess-algebraic-to-ply - (chess-ply-pos (car (last (chess-game-plies game)))) - (cadr info) t))) + (chess-game-data game 'my-color))) + (let ((ply (chess-algebraic-to-ply + (chess-ply-pos (car (last (chess-game-plies game)))) + (cadr info) t))) (chess-game-set-data game 'white-remaining (nth 4 info)) (chess-game-set-data game 'black-remaining (nth 5 info)) (chess-game-move game ply)) (assert (equal (car info) (chess-engine-position nil)))) (let ((chess-game-inhibit-events t) plies) - (chess-game-set-data (chess-engine-game nil) - 'my-color (string= (nth 2 info) chess-ics-handle)) - (chess-game-set-data (chess-engine-game nil) 'active t) - (chess-game-set-start-position (chess-engine-game nil) (car info))) - (chess-game-run-hooks (chess-engine-game nil) 'orient)) + (chess-game-set-data game 'my-color + (string= (nth 2 info) chess-ics-handle)) + (chess-game-set-data game 'active t) + (chess-game-set-start-position game (car info))) + (chess-game-run-hooks game 'orient)) (goto-char begin) (delete-region begin end) ;; we need to counter the `forward-line' in `chess-engine-filter' |
