]> git.sesse.net Git - stockfish/blobdiff - src/position.cpp
Merge remote-tracking branch 'upstream/master'
[stockfish] / src / position.cpp
index a1643d6d280d878feb0405576efc5685d0a6c7a9..5dc6050f081fbfc412111dc1334df1bf259cfeb3 100644 (file)
@@ -1052,7 +1052,10 @@ Key Position::key_after(Move m) const {
   if (captured)
       k ^= Zobrist::psq[captured][to];
 
-  return k ^ Zobrist::psq[pc][to] ^ Zobrist::psq[pc][from];
+  k ^= Zobrist::psq[pc][to] ^ Zobrist::psq[pc][from];
+
+  return (captured || type_of(pc) == PAWN)
+      ? k : adjust_key50<true>(k);
 }
 
 
@@ -1097,10 +1100,12 @@ bool Position::see_ge(Move m, Value threshold) const {
       // Don't allow pinned pieces to attack as long as there are
       // pinners on their original square.
       if (pinners(~stm) & occupied)
+      {
           stmAttackers &= ~blockers_for_king(stm);
 
-      if (!stmAttackers)
-          break;
+          if (!stmAttackers)
+              break;
+      }
 
       res ^= 1;