From 2ba07228431e9ac3000c5731a34ef7bcf2225189 Mon Sep 17 00:00:00 2001 From: Mario Lang Date: Wed, 28 Jan 2004 21:26:37 +0000 Subject: (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. --- chess-ply.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'chess-ply.el') 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)) -- cgit v1.2.3