mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-19 00:26:33 +08:00
Change piece_attacks_square() API
An extra argument let us simplify some code. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -539,7 +539,7 @@ bool move_is_legal(const Position& pos, const Move m, Bitboard pinned) {
|
||||
}
|
||||
|
||||
// Luckly we can handle all the other pieces in one go
|
||||
return ( pos.piece_attacks_square(from, to)
|
||||
return ( pos.piece_attacks_square(pos.piece_on(from), from, to)
|
||||
&& pos.pl_move_is_legal(m, pinned)
|
||||
&& !move_promotion(m));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user