1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-05-02 01:29:36 +00:00

Fix x-ray attack from behind in evaluate_passed_pawns()

Fix a condition for x-ray attack of a queen or
a rook behind a pawn of us. Previous condition does
not check if the enemy slider behind our pawn is
really attacking the pawn.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba 2009-10-11 18:30:35 +02:00
parent ab4d26f9bd
commit 2655f93c32

View file

@ -940,8 +940,8 @@ namespace {
// If there is an enemy rook or queen attacking the pawn from behind, // If there is an enemy rook or queen attacking the pawn from behind,
// add all X-ray attacks by the rook or queen. // add all X-ray attacks by the rook or queen.
if ( bit_is_set(ei.attacked_by(Them, ROOK) | ei.attacked_by(Them, QUEEN), s) if ( (squares_behind(Us, s) & pos.pieces(ROOK, QUEEN, Them))
&& (squares_behind(Us, s) & pos.pieces(ROOK, QUEEN, Them))) && (squares_behind(Us, s) & pos.pieces(ROOK, QUEEN, Them) & pos.attacks_from<QUEEN>(s)))
b3 = b2; b3 = b2;
// Are any of the squares in the pawn's path attacked or occupied by the enemy? // Are any of the squares in the pawn's path attacked or occupied by the enemy?