mirror of
https://github.com/sockspls/badfish
synced 2025-07-11 19:49:14 +00:00
Correctly handle castle in see()
Suggested by Onno. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
5b7a141065
commit
13d8af1852
1 changed files with 6 additions and 0 deletions
|
@ -1513,6 +1513,12 @@ int Position::see(Move m) const {
|
||||||
|
|
||||||
assert(move_is_ok(m));
|
assert(move_is_ok(m));
|
||||||
|
|
||||||
|
// As castle moves are implemented as capturing the rook, they have
|
||||||
|
// SEE == RookValueMidgame most of the times (unless the rook is under
|
||||||
|
// attack).
|
||||||
|
if (move_is_castle(m))
|
||||||
|
return 0;
|
||||||
|
|
||||||
from = move_from(m);
|
from = move_from(m);
|
||||||
to = move_to(m);
|
to = move_to(m);
|
||||||
capturedType = type_of_piece_on(to);
|
capturedType = type_of_piece_on(to);
|
||||||
|
|
Loading…
Add table
Reference in a new issue