mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-22 01:56:58 +08:00
Rewrite some bitboard init code
And move the static function Position::attacks_from() to bitboard code renaming it attacks_bb() No functional change.
This commit is contained in:
@@ -1351,7 +1351,7 @@ moves_loop: // When in check and at SpNode search starts from here
|
||||
return true;
|
||||
|
||||
// Second's destination is defended by the first move's piece
|
||||
Bitboard m1att = pos.attacks_from(pos.piece_on(m1to), m1to, pos.pieces() ^ m2from);
|
||||
Bitboard m1att = attacks_bb(pos.piece_on(m1to), m1to, pos.pieces() ^ m2from);
|
||||
if (m1att & m2to)
|
||||
return true;
|
||||
|
||||
@@ -1395,7 +1395,7 @@ moves_loop: // When in check and at SpNode search starts from here
|
||||
Piece pc = pos.piece_on(m1from);
|
||||
|
||||
// The moved piece attacks the square 'tto' ?
|
||||
if (pos.attacks_from(pc, m1to, occ) & m2to)
|
||||
if (attacks_bb(pc, m1to, occ) & m2to)
|
||||
return true;
|
||||
|
||||
// Scan for possible X-ray attackers behind the moved piece
|
||||
|
||||
Reference in New Issue
Block a user