]> git.sesse.net Git - stockfish/blobdiff - src/position.cpp
Revert "Yet another attempt at signature-build"
[stockfish] / src / position.cpp
index 3526a3d023a5ef38a9e214193bb15820cd30f780..cecdcbf8a0e2e59029a7890011e9ecbd683c952a 100644 (file)
@@ -79,8 +79,6 @@ PieceType min_attacker(const Bitboard* bb, const Square& to, const Bitboard& stm
       if (Pt == ROOK || Pt == QUEEN)
           attackers |= attacks_bb<ROOK>(to, occupied) & (bb[ROOK] | bb[QUEEN]);
 
-      attackers &= occupied; // Remove the just found attacker
-
       return (PieceType)Pt;
   }
   return min_attacker<Pt+1>(bb, to, stmAttackers, occupied, attackers);
@@ -1209,6 +1207,7 @@ int Position::see(Move m, int asymmThreshold) const {
 
       // Locate and remove the next least valuable attacker
       captured = min_attacker<PAWN>(byTypeBB, to, stmAttackers, occupied, attackers);
+      attackers &= occupied; // Remove the just found attacker
       stm = ~stm;
       stmAttackers = attackers & pieces(stm);