Make sure we don't move a nonexistent piece in SEE

added assert.

closes https://github.com/official-stockfish/Stockfish/pull/6342

No functional change
This commit is contained in:
Daniel Monroe
2025-10-06 04:47:37 -04:00
committed by Joost VandeVondele
parent ee243f0fdc
commit feb17e5acf
+2
View File
@@ -1105,6 +1105,8 @@ bool Position::see_ge(Move m, int threshold) const {
Square from = m.from_sq(), to = m.to_sq();
assert(piece_on(from) != NO_PIECE);
int swap = PieceValue[piece_on(to)] - threshold;
if (swap < 0)
return false;