mirror of
https://github.com/sockspls/badfish
synced 2025-04-29 16:23:09 +00:00
Use do_move_bb() in move_attacks_square()
No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
d440ddb487
commit
5dfbbb79be
1 changed files with 6 additions and 6 deletions
|
@ -523,6 +523,7 @@ bool Position::move_attacks_square(Move m, Square s) const {
|
||||||
assert(move_is_ok(m));
|
assert(move_is_ok(m));
|
||||||
assert(square_is_ok(s));
|
assert(square_is_ok(s));
|
||||||
|
|
||||||
|
Bitboard occ, xray;
|
||||||
Square f = move_from(m), t = move_to(m);
|
Square f = move_from(m), t = move_to(m);
|
||||||
|
|
||||||
assert(square_is_occupied(f));
|
assert(square_is_occupied(f));
|
||||||
|
@ -531,12 +532,11 @@ bool Position::move_attacks_square(Move m, Square s) const {
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// Move the piece and scan for X-ray attacks behind it
|
// Move the piece and scan for X-ray attacks behind it
|
||||||
Bitboard occ = occupied_squares();
|
occ = occupied_squares();
|
||||||
Color us = color_of_piece_on(f);
|
do_move_bb(&occ, make_move_bb(f, t));
|
||||||
clear_bit(&occ, f);
|
xray = ( (rook_attacks_bb(s, occ) & pieces(ROOK, QUEEN))
|
||||||
set_bit(&occ, t);
|
|(bishop_attacks_bb(s, occ) & pieces(BISHOP, QUEEN)))
|
||||||
Bitboard xray = ( (rook_attacks_bb(s, occ) & pieces(ROOK, QUEEN))
|
& pieces_of_color(color_of_piece_on(f));
|
||||||
|(bishop_attacks_bb(s, occ) & pieces(BISHOP, QUEEN))) & pieces_of_color(us);
|
|
||||||
|
|
||||||
// If we have attacks we need to verify that are caused by our move
|
// If we have attacks we need to verify that are caused by our move
|
||||||
// and are not already existent ones.
|
// and are not already existent ones.
|
||||||
|
|
Loading…
Add table
Reference in a new issue