summaryrefslogtreecommitdiff
path: root/chess-ply.el
diff options
context:
space:
mode:
authorMario Lang <mlang@delysid.org>2004-01-28 21:26:37 +0000
committerMario Lang <mlang@delysid.org>2004-01-28 21:26:37 +0000
commit2ba07228431e9ac3000c5731a34ef7bcf2225189 (patch)
tree8075cfa3399f187fe9c77b504147e7fd0a18e459 /chess-ply.el
parenta3fea58794cdc7f5d5761e034a4eb3ad06842753 (diff)
(chess-ply-castling-changes): When doing a long castle, only check if
the king can move to the d or c file without being in check. According to the crafty-list, it is legal to do a long castle if some opponent piece is attacking the b file.
Diffstat (limited to 'chess-ply.el')
-rw-r--r--chess-ply.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/chess-ply.el b/chess-ply.el
index 1b72b0f..3ba0a40 100644
--- a/chess-ply.el
+++ b/chess-ply.el
@@ -150,7 +150,9 @@
(setq pos (chess-incr-index king 0 bias))
(while (and pos (not (equal pos rook))
(chess-pos-piece-p position pos ? )
- (chess-pos-legal-candidates position color pos (list king)))
+ (or (and long (< (chess-index-file pos) 2))
+ (chess-pos-legal-candidates
+ position color pos (list king))))
(setq pos (chess-incr-index pos 0 bias)))
(if (equal pos rook)
(list king (chess-rf-to-index (if color 7 0) (if long 2 6))