- // If captured piece is defended by enemy pawns or knights then SEE is negative
- // when captured piece value is not enough to compensate the lost of capturing one.
- if (shortcut)
- {
- int diff = seeValues[piece] - seeValues[capture];
-
- if ( diff > seeValues[PAWN]
- &&(attacks_from<PAWN>(to, us) & pieces(PAWN, them)))
- return -(diff - seeValues[PAWN] / 2);
-
- if ( diff > seeValues[KNIGHT]
- && pieces(KNIGHT, them)
- &&(pieces(KNIGHT, them) & attacks_from<KNIGHT>(to)))
- return -(diff - seeValues[KNIGHT] / 2);
- }
+ // King cannot be recaptured
+ if (type_of_piece(piece) == KING)
+ return seeValues[capture];