diff options
| author | John Wiegley <johnw@newartisans.com> | 2018-08-29 22:49:20 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-08-29 22:49:20 -0700 |
| commit | 67339d896aa65d75272b80134a8128276c8c6a0f (patch) | |
| tree | 09eb145ffcbaf89d873c89e8346ee8d38a88ebbe /chess-engine.el | |
| parent | 29dd9bb233e149cae62a2277020074f8fec1eec8 (diff) | |
| parent | 800dd7677276f9e425c5db37b3e31e56ab1dad32 (diff) | |
Merge pull request #23 from dickmao/fix-castling-legality
Add tests for castling legality and ics response handling.
Diffstat (limited to 'chess-engine.el')
| -rw-r--r-- | chess-engine.el | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/chess-engine.el b/chess-engine.el index 0fef4b0..0ac7541 100644 --- a/chess-engine.el +++ b/chess-engine.el @@ -136,7 +136,7 @@ If conversion fails, this function fired an 'illegal event." ((eq event 'match) (if (chess-game-data game 'active) (chess-engine-command nil 'busy) - (let ((name (and (> (length (car args)) 0) (car args)))) + (let ((name (> (length (car args)) 0))) (if (y-or-n-p (if name (chess-string 'want-to-play (car args)) (chess-string 'want-to-play-a))) @@ -291,9 +291,10 @@ If conversion fails, this function fired an 'illegal event." (chess-game-run-hooks game 'flag-fell)))) ((eq event 'flag-fell) - (chess-message 'opp-flag-fell) - (chess-game-end game :flag-fell) - (chess-game-set-data game 'active nil)) + (let ((chess-engine-handling-event t)) + (chess-message 'opp-flag-fell) + (chess-game-end game :flag-fell) + (chess-game-set-data game 'active nil))) ((eq event 'kibitz) (let ((chess-engine-handling-event t)) |
