]> git.sesse.net Git - stockfish/blobdiff - src/evaluate.cpp
Simplify condition for ThreatByRook
[stockfish] / src / evaluate.cpp
index 5ceb9ae145cab0234ac8127c7ec3ea7868670bc5..df3f89698fb1c7ef1048a4961e51f19a18ac78ce 100644 (file)
@@ -542,7 +542,7 @@ namespace {
                 score += ThreatByRank * (int)relative_rank(Them, s);
         }
 
-        b = (pos.pieces(Them, QUEEN) | weak) & attackedBy[Us][ROOK];
+        b = weak & attackedBy[Us][ROOK];
         while (b)
         {
             Square s = pop_lsb(&b);
@@ -557,10 +557,7 @@ namespace {
 
         score += Hanging * popcount(weak & ~attackedBy[Them][ALL_PIECES]);
 
-        // Bonus for overload (non-pawn enemies attacked once or more and defended exactly once)
-        b =  nonPawnEnemies
-           & attackedBy[Us][ALL_PIECES]
-           & attackedBy[Them][ALL_PIECES] & ~attackedBy2[Them];
+        b = weak & nonPawnEnemies & attackedBy[Them][ALL_PIECES];
         score += Overload * popcount(b);
     }