mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 09:47:46 +00:00
Bug wrong evasion detection for king moves
When we are in check and we move the king then testing with pl_move_is_legal(m, pinned) is not enough becuase we cannot rely on attackers_to() but we have to explicitly remove the king form the occupied bitboard to catch as invalid moves like b1a1 when opposite queen is on c1. Our move generator already produces correct evasions so we just need to add the extra verification to move_is_legal(). No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
+1
-1
@@ -178,6 +178,7 @@ public:
|
||||
|
||||
// Information about attacks to or from a given square
|
||||
Bitboard attackers_to(Square s) const;
|
||||
Bitboard attackers_to(Square s, Bitboard occ) const;
|
||||
Bitboard attacks_from(Piece p, Square s) const;
|
||||
static Bitboard attacks_from(Piece p, Square s, Bitboard occ);
|
||||
template<PieceType> Bitboard attacks_from(Square s) const;
|
||||
@@ -185,7 +186,6 @@ public:
|
||||
|
||||
// Properties of moves
|
||||
bool pl_move_is_legal(Move m, Bitboard pinned) const;
|
||||
bool pl_move_is_evasion(Move m, Bitboard pinned) const;
|
||||
bool move_is_legal(const Move m) const;
|
||||
bool move_is_legal(const Move m, Bitboard pinned) const;
|
||||
bool move_gives_check(Move m) const;
|
||||
|
||||
Reference in New Issue
Block a user