X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fposition.cpp;h=6f8747635772aa930a604025bd5b0c95a67dbbc2;hb=e4695f15bc62c0e34572b3a995e25b7461d2ae90;hp=8f38493027b07e9f8c273ae95d73f046ea8026b3;hpb=a08a21d5a0b5aafcdb340364bf73b13d852349a0;p=stockfish diff --git a/src/position.cpp b/src/position.cpp index 8f384930..6f874763 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -1080,13 +1080,18 @@ int Position::see(Move m) const { // Locate and remove the next least valuable attacker captured = min_attacker(byTypeBB, to, stmAttackers, occupied, attackers); - stm = ~stm; - stmAttackers = attackers & pieces(stm); // Stop before processing a king capture - if (captured == KING && stmAttackers) + if (captured == KING) + { + if (stmAttackers == attackers) + ++slIndex; + break; + } + stm = ~stm; + stmAttackers = attackers & pieces(stm); ++slIndex; } while (stmAttackers);