]> git.sesse.net Git - stockfish/blobdiff - src/position.cpp
Revert "Fix critical SEE bug (take 2)"
[stockfish] / src / position.cpp
index cecdcbf8a0e2e59029a7890011e9ecbd683c952a..8ea3f00a7881abee5bc80bd472da882359f0fc64 100644 (file)
@@ -1195,12 +1195,6 @@ int Position::see(Move m, int asymmThreshold) const {
   do {
       assert(slIndex < 32);
 
   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++;
       // Add the new entry to the swap list
       swapList[slIndex] = -swapList[slIndex - 1] + PieceValue[MG][captured];
       slIndex++;
@@ -1211,6 +1205,15 @@ int Position::see(Move m, int asymmThreshold) const {
       stm = ~stm;
       stmAttackers = attackers & pieces(stm);
 
       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
   } while (stmAttackers);
 
   // If we are doing asymmetric SEE evaluation and the same side does the first