X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.cpp;h=b6dc31b4ed0cfa6271d719da333f3c4d94a4ad05;hp=bda83d7a138f8a6dc8c80b7b99a8bb75382e9d36;hb=741523eda8e0d1fb418d579c7cda9a73040b8914;hpb=04eb87fd081c0a77d3a261b07cea4808d4ced9cc diff --git a/src/position.cpp b/src/position.cpp index bda83d7a..b6dc31b4 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -1004,21 +1004,17 @@ bool Position::see_ge(Move m, Value threshold) const { Bitboard occupied, stmAttackers; balance = PieceValue[MG][piece_on(to)]; - occupied = 0; if (balance < threshold) return false; - if (nextVictim == KING) - return true; - balance -= PieceValue[MG][nextVictim]; - if (balance >= threshold) + if (balance >= threshold) // Always true if nextVictim == KING return true; bool relativeStm = true; // True if the opponent is to move - occupied ^= pieces() ^ from ^ to; + occupied = pieces() ^ from ^ to; // Find all attackers to the destination square, with the moving piece removed, // but possibly an X-ray attacker added behind it.