1
0
Fork 0
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:
Marco Costalba 2011-05-20 06:57:20 +01:00
parent 5b7a141065
commit 13d8af1852

View file

@ -1513,6 +1513,12 @@ int Position::see(Move m) const {
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);
to = move_to(m);
capturedType = type_of_piece_on(to);