mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-17 07:36:23 +08:00
Correctly handle castle in see()
Suggested by Onno. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user