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:
Marco Costalba
2009-09-20 10:26:54 +01:00
parent f74f42b298
commit 6845397c5c
7 changed files with 80 additions and 79 deletions

View File

@@ -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