summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2002-04-24 19:56:54 +0000
committerJohn Wiegley <johnw@newartisans.com>2002-04-24 19:56:54 +0000
commitda58e86d8e2d128f0b2519b08593d79da83d0c73 (patch)
tree8a8025b09f8324a07fe1261d029d777d377b97c3
parentf996624fccdf03feb2a914f193659e99095f858d (diff)
*** no comment ***
-rw-r--r--chess-announce.el8
-rw-r--r--chess-display.el3
-rw-r--r--chess-engine.el3
-rw-r--r--chess-ics.el5
-rw-r--r--chess-sound.el8
5 files changed, 17 insertions, 10 deletions
diff --git a/chess-announce.el b/chess-announce.el
index 98bf2e2..e4031b8 100644
--- a/chess-announce.el
+++ b/chess-announce.el
@@ -60,8 +60,8 @@ shutdown the announcer process, if necessary.")
(chess-pos-side-to-move pos))
(let* ((source (chess-ply-source ply))
(target (chess-ply-target ply))
- (s-piece (chess-pos-piece pos source))
- (t-piece (chess-pos-piece pos target))
+ (s-piece (and source (chess-pos-piece pos source)))
+ (t-piece (and target (chess-pos-piece pos target)))
(which (chess-ply-keyword ply :which))
text)
(if which
@@ -71,7 +71,7 @@ shutdown the announcer process, if necessary.")
(setq text (chess-string 'short-castle)))
((chess-ply-keyword ply :long-castle)
(setq text (chess-string 'long-castle)))
- ((= t-piece ? )
+ ((and s-piece t-piece (= t-piece ? ) target)
(setq text
(concat which
(chess-string 'piece-moves
@@ -79,7 +79,7 @@ shutdown the announcer process, if necessary.")
(cdr (assq (downcase s-piece)
chess-announce-names)))
(chess-index-to-coord target)))))
- (t
+ ((and s-piece t-piece target)
(setq text
(concat which
(chess-string 'piece-takes
diff --git a/chess-display.el b/chess-display.el
index 271d4b6..59699b4 100644
--- a/chess-display.el
+++ b/chess-display.el
@@ -559,7 +559,8 @@ The key bindings available in this mode are:
(defsubst chess-display-active-p ()
"Return non-nil if the displayed chessboard reflects an active game.
Basically, it means we are playing, not editing or reviewing."
- (and (= chess-display-index
+ (and (chess-game-data chess-module-game 'active)
+ (= chess-display-index
(chess-game-index chess-module-game))
(not (chess-game-over-p chess-module-game))
(not chess-display-edit-mode)))
diff --git a/chess-engine.el b/chess-engine.el
index 5f5292f..090332e 100644
--- a/chess-engine.el
+++ b/chess-engine.el
@@ -251,7 +251,8 @@
t))
((eq event 'illegal)
- (chess-message 'opp-illegal))
+ (chess-message 'opp-illegal)
+ (chess-game-undo game 1))
((eq event 'call-flag)
;; jww (2002-04-21): what to do here?
diff --git a/chess-ics.el b/chess-ics.el
index 39bae50..508c4fa 100644
--- a/chess-ics.el
+++ b/chess-ics.el
@@ -204,6 +204,11 @@ who is black."
(funcall chess-engine-response-handler 'accept)))))
(cons "<12> \\(.+\\)"
'chess-ics-handle-move)
+ (cons "Illegal move (\\([^)]+\\))\\."
+ (function
+ (lambda ()
+ (funcall chess-engine-response-handler 'illegal
+ (match-string 1)))))
(cons "Challenge: \\(\\S-+\\) \\S-+ \\S-+ \\S-+ .+"
(function
(lambda ()
diff --git a/chess-sound.el b/chess-sound.el
index 9713ec8..4a34121 100644
--- a/chess-sound.el
+++ b/chess-sound.el
@@ -68,8 +68,8 @@
(chess-sound "move"))
(let* ((source (chess-ply-source ply))
(target (chess-ply-target ply))
- (s-piece (chess-pos-piece pos source))
- (t-piece (chess-pos-piece pos target))
+ (s-piece (and source (chess-pos-piece pos source)))
+ (t-piece (and target (chess-pos-piece pos target)))
(which (chess-ply-keyword ply :which))
text)
(cond
@@ -77,12 +77,12 @@
(chess-sound "O-O"))
((chess-ply-keyword ply :long-castle)
(chess-sound "O-O-O"))
- ((= t-piece ? )
+ ((and s-piece t-piece (= t-piece ? ) target)
(if which
(chess-sound (char-to-string which)))
(chess-sound (format "%c_" (downcase s-piece)))
(chess-sound (chess-index-to-coord target)))
- (t
+ ((and s-piece t-piece target)
(if which
(chess-sound (char-to-string which)))
(chess-sound (format "%c_" (downcase s-piece)))