1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 08:43:09 +00:00

Move a comment where it belongs in SEE

No functional change of course.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba 2009-10-02 08:33:26 +01:00
parent 3713bb26ef
commit da9c423989

View file

@ -1321,7 +1321,7 @@ int Position::see(Square from, Square to) const {
0, 0 0, 0
}; };
Bitboard attackers, stmAttackers, occ, b; Bitboard attackers, stmAttackers, b;
assert(square_is_ok(from) || from == SQ_NONE); assert(square_is_ok(from) || from == SQ_NONE);
assert(square_is_ok(to)); assert(square_is_ok(to));
@ -1333,10 +1333,7 @@ int Position::see(Square from, Square to) const {
// Initialize pieces // Initialize pieces
Piece piece = piece_on(from); Piece piece = piece_on(from);
Piece capture = piece_on(to); Piece capture = piece_on(to);
Bitboard 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 en passant moves // Handle en passant moves
if (st->epSquare == to && type_of_piece_on(from) == PAWN) if (st->epSquare == to && type_of_piece_on(from) == PAWN)
@ -1353,6 +1350,8 @@ int Position::see(Square from, Square to) const {
while (true) while (true)
{ {
// Find all attackers to the destination square, with the moving piece
// removed, but possibly an X-ray attacker added behind it.
clear_bit(&occ, from); clear_bit(&occ, from);
attackers = (rook_attacks_bb(to, occ) & pieces(ROOK, QUEEN)) attackers = (rook_attacks_bb(to, occ) & pieces(ROOK, QUEEN))
| (bishop_attacks_bb(to, occ) & pieces(BISHOP, QUEEN)) | (bishop_attacks_bb(to, occ) & pieces(BISHOP, QUEEN))