mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 00:56:39 +08:00
Rename piece_attacks() in piece_attacks_from()
It is a bit longer but much easier to understand especially for people new to the sources. I remember it was not trivial for me to understand the returned attack bitboard refers to attacks launched from the given square and not attacking the given square. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -2182,7 +2182,7 @@ namespace {
|
||||
|
||||
// Case 4: The destination square for m2 is attacked by the moving piece in m1
|
||||
p = pos.piece_on(t1);
|
||||
if (bit_is_set(pos.piece_attacks(p, t1), t2))
|
||||
if (bit_is_set(pos.piece_attacks_from(p, t1), t2))
|
||||
return true;
|
||||
|
||||
// Case 5: Discovered check, checking piece is the piece moved in m1
|
||||
|
||||
Reference in New Issue
Block a user