]> git.sesse.net Git - stockfish/commitdiff
Revert "Fix critical SEE bug (take 2)"
authorMarco Costalba <mcostalba@gmail.com>
Sat, 20 Jul 2013 13:26:52 +0000 (15:26 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 20 Jul 2013 16:45:38 +0000 (18:45 +0200)
This reverts commit 3e95800814d

For some reason it fails the short TC test:
LLR: -2.96 (-2.94,2.94)
Total: 20033 W: 4214 L: 4265 D: 11554

bench: 4769737

src/position.cpp

index cecdcbf8a0e2e59029a7890011e9ecbd683c952a..8ea3f00a7881abee5bc80bd472da882359f0fc64 100644 (file)
@@ -1195,12 +1195,6 @@ 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++;
@@ -1211,6 +1205,15 @@ 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