X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fposition.cpp;h=8d4b9f4f3c53de66f382dee30529aa46986ae91e;hb=47a076810291cb7e9b9333e106f2aa9cd4c30c58;hp=cc320b4b3e45d55aba64cbc2194f71795ba5d35f;hpb=8b0fee9998e2ae530fa57e55f6cf145779aef3d0;p=stockfish diff --git a/src/position.cpp b/src/position.cpp index cc320b4b..8d4b9f4f 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -1098,21 +1098,11 @@ Value Position::see(Move m) const { // Locate and remove the next least valuable attacker captured = min_attacker(byTypeBB, to, stmAttackers, occupied, attackers); - - // Stop before processing a king capture - if (captured == KING) - { - if (stmAttackers == attackers) - ++slIndex; - - break; - } - stm = ~stm; stmAttackers = attackers & pieces(stm); ++slIndex; - } while (stmAttackers); + } while (stmAttackers && (captured != KING || (--slIndex, false))); // Stop before a king capture // Having built the swap list, we negamax through it to find the best // achievable score from the point of view of the side to move.