From 2c25623b032fc164904161931520b662d32205aa Mon Sep 17 00:00:00 2001 From: Mario Lang Date: Mon, 7 Apr 2014 03:42:42 +0200 Subject: chess-search-position: Also consider opponent king moves when checking for check. With this the rule that there always needs to be one square between kings is honours in chess-legal-plies. Without this fix, a move next to the opponents king was considered legal. --- chess-pos.el | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'chess-pos.el') diff --git a/chess-pos.el b/chess-pos.el index 63e29ee..57f47be 100644 --- a/chess-pos.el +++ b/chess-pos.el @@ -727,9 +727,7 @@ If NO-CASTLING is non-nil, do not consider castling moves." ;; from any piece movement. This is useful for testing whether a ;; king is in check, for example. ((memq piece '(t nil)) - (dolist (p (if check-only - '(?P ?R ?N ?B ?Q) - '(?P ?R ?N ?B ?Q ?K))) + (dolist (p '(?P ?R ?N ?B ?Q ?K)) (mapc 'chess--add-candidate (chess-search-position position target (if piece p (downcase p)) -- cgit v1.2.3