X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.cpp;h=b254d60b2020bc9632d2f20e002699d8bb4b8e98;hp=59c3a8c39f882f1bcb347f6dfeda5a78acfc7c10;hb=13d8af18527c325177393e1c918704e2962e77b3;hpb=5b7a141065194da0b6640c3b4b27911a67557e21 diff --git a/src/position.cpp b/src/position.cpp index 59c3a8c3..b254d60b 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -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);