summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
2d0146f)
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
// Find all attackers to the destination square, with the moving piece
// removed, but possibly an X-ray attacker added behind it.
occ = occupied_squares();
// Find all attackers to the destination square, with the moving piece
// removed, but possibly an X-ray attacker added behind it.
occ = occupied_squares();
+
+ // Handle enpassant moves
+ if (ep_square() == to && type_of_piece_on(from) == PAWN)
+ {
+ assert(capture == EMPTY);
+
+ Square capQq = (side_to_move() == WHITE)? (to - DELTA_N) : (to - DELTA_S);
+ capture = piece_on(capQq);
+
+ assert(type_of_piece_on(capQq) == PAWN);
+
+ // Remove the captured pawn
+ clear_bit(&occ, capQq);
+ }
+
while (true)
{
clear_bit(&occ, from);
while (true)
{
clear_bit(&occ, from);
if ( !PruneBlockingMoves
&& threat != MOVE_NONE
&& piece_is_slider(pos.piece_on(tfrom))
if ( !PruneBlockingMoves
&& threat != MOVE_NONE
&& piece_is_slider(pos.piece_on(tfrom))
- && bit_is_set(squares_between(tfrom, tto), mto) && pos.see(m) >= 0)
+ && bit_is_set(squares_between(tfrom, tto), mto)
+ && pos.see(m) >= 0)
return false;
return true;
return false;
return true;