diff options
| author | John Wiegley <johnw@newartisans.com> | 2002-04-26 03:27:40 +0000 |
|---|---|---|
| committer | John Wiegley <johnw@newartisans.com> | 2002-04-26 03:27:40 +0000 |
| commit | 0e302a828c7e79491b5055cbeb0d8879cc3d8558 (patch) | |
| tree | 3b666f8db828ec78a449e2cad38a328c190a1985 /chess-engine.el | |
| parent | 738ff9a3b57b5e317e086a9ee4878fbb45f24b3e (diff) | |
fixes
Diffstat (limited to 'chess-engine.el')
| -rw-r--r-- | chess-engine.el | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/chess-engine.el b/chess-engine.el index 14cae60..1ebbd76 100644 --- a/chess-engine.el +++ b/chess-engine.el @@ -87,26 +87,28 @@ (let ((game (chess-engine-game nil))) (cond ((eq event 'move) - (if (chess-game-data game 'active) - ;; we don't want the `move' event coming back to us - (let ((chess-engine-handling-event t)) - (when (car args) - ;; if the game index is still 0, then our opponent - ;; is white, and we need to pass over the move - (when (and (not chess-engine-inhibit-auto-pass) - (chess-game-data game 'my-color) - (= (chess-game-index game) 0)) - (chess-game-set-tag game "White" chess-engine-opponent-name) - (chess-game-set-tag game "Black" chess-full-name) - (chess-message 'now-black) - (chess-game-run-hooks game 'pass) - ;; if no one else flipped my-color, we'll do it - (if (chess-game-data game 'my-color) - (chess-game-set-data game 'my-color nil))) - (chess-game-move game (car args)) - (if (chess-game-over-p game) - (chess-game-set-data game 'active nil)) - t)))) + (let ((chess-engine-handling-event t)) + (when (and (car args) + (chess-game-data game 'active)) + + ;; if the game index is still 0, then our opponent + ;; is white, and we need to pass over the move + (when (and (not chess-engine-inhibit-auto-pass) + (chess-game-data game 'my-color) + (= (chess-game-index game) 0)) + (chess-game-set-tag game "White" chess-engine-opponent-name) + (chess-game-set-tag game "Black" chess-full-name) + (chess-message 'now-black) + (chess-game-run-hooks game 'pass) + ;; if no one else flipped my-color, we'll do it + (if (chess-game-data game 'my-color) + (chess-game-set-data game 'my-color nil))) + + (chess-game-move game (car args)) + + (if (chess-game-over-p game) + (chess-game-set-data game 'active nil)) + t))) ((eq event 'pass) (when (chess-game-data game 'active) |
