mirror of
https://github.com/official-stockfish/Stockfish.git
synced 2025-11-01 06:32:32 +00:00
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:
committed by
Joost VandeVondele
parent
ee243f0fdc
commit
feb17e5acf
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user