X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.cpp;h=6f8747635772aa930a604025bd5b0c95a67dbbc2;hp=325f3e4db6b2ce023eadef0e575e0245237ec0f3;hb=ddeb01612b122bbeeb59a26ba6f8c6f1e4283199;hpb=db05b1f9f576e80373ca73899df21226fcb4ac8d diff --git a/src/position.cpp b/src/position.cpp index 325f3e4d..6f874763 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -1077,20 +1077,23 @@ int Position::see(Move m) const { // Add the new entry to the swap list swapList[slIndex] = -swapList[slIndex - 1] + PieceValue[MG][captured]; - ++slIndex; // 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) { - swapList[slIndex++] = QueenValueMg * 16; + if (stmAttackers == attackers) + ++slIndex; + break; } + stm = ~stm; + stmAttackers = attackers & pieces(stm); + ++slIndex; + } while (stmAttackers); // Having built the swap list, we negamax through it to find the best