]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Use correct occupancy in connected_threat()
[stockfish] / src / search.cpp
index 2b51a698b0de3e40c8208255251a92fc0149faf0..ed8aa777bee172e77be003d7770994d7cb7b1088 100644 (file)
@@ -1426,8 +1426,8 @@ split_point_start: // At split points actual search starts from here
         && (   PieceValue[MG][pos.piece_on(tfrom)] >= PieceValue[MG][pos.piece_on(tto)]
             || type_of(pos.piece_on(tfrom)) == KING))
     {
-        // Update occupancy as if the piece is moving
-        Bitboard occ = pos.pieces() ^ mfrom ^ mto;
+        // Update occupancy as if the piece and the threat are moving
+        Bitboard occ = pos.pieces() ^ mfrom ^ mto ^ tfrom;
         Piece piece = pos.piece_on(mfrom);
 
         // The moved piece attacks the square 'tto' ?