diff --git a/src/position.cpp b/src/position.cpp index 8ea3f00a..cecdcbf8 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -1195,6 +1195,12 @@ int Position::see(Move m, int asymmThreshold) const { do { assert(slIndex < 32); + if (captured == KING) // Stop before processing a king capture + { + swapList[slIndex++] = QueenValueMg * 16; + break; + } + // Add the new entry to the swap list swapList[slIndex] = -swapList[slIndex - 1] + PieceValue[MG][captured]; slIndex++; @@ -1205,15 +1211,6 @@ int Position::see(Move m, int asymmThreshold) const { stm = ~stm; stmAttackers = attackers & pieces(stm); - if (captured == KING) - { - // Stop before processing a king capture - if (stmAttackers) - swapList[slIndex++] = QueenValueMg * 16; - - break; - } - } while (stmAttackers); // If we are doing asymmetric SEE evaluation and the same side does the first