diff options
| author | Mario Lang <mlang@delysid.org> | 2014-04-07 03:42:42 +0200 |
|---|---|---|
| committer | Mario Lang <mlang@delysid.org> | 2014-04-07 03:42:42 +0200 |
| commit | 2c25623b032fc164904161931520b662d32205aa (patch) | |
| tree | 659f9ea44abffe6cf71c5edcf78eeb51b1c1f79c /chess-pos.el | |
| parent | 77ff256a8ae93a2fa6d29b4f08afdaf36f206eec (diff) | |
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.
Diffstat (limited to 'chess-pos.el')
| -rw-r--r-- | chess-pos.el | 4 |
1 files changed, 1 insertions, 3 deletions
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)) |
