X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=e39bcb4a8e99721820fa637151ace370d009f5d9;hp=3e0533b20c7d8c730c08976bb5c016f39746b742;hb=06a8fd2154db41c4e438a1b065c1471d0dfd5815;hpb=0cfb653eeca1bc44b9d331498a9ccb3e9b97a9c1;ds=sidebyside diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 3e0533b2..e39bcb4a 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -520,17 +520,13 @@ namespace { // Non-pawn enemies attacked by a pawn nonPawnEnemies = pos.pieces(Them) ^ pos.pieces(Them, PAWN); - weak = nonPawnEnemies & attackedBy[Us][PAWN]; - if (weak) - { - // Our safe or protected pawns - b = pos.pieces(Us, PAWN) - & (~attackedBy[Them][ALL_PIECES] | attackedBy[Us][ALL_PIECES]); + // Our safe or protected pawns + b = pos.pieces(Us, PAWN) + & (~attackedBy[Them][ALL_PIECES] | attackedBy[Us][ALL_PIECES]); - safeThreats = pawn_attacks_bb(b) & weak; - score += ThreatBySafePawn * popcount(safeThreats); - } + safeThreats = pawn_attacks_bb(b) & nonPawnEnemies; + score += ThreatBySafePawn * popcount(safeThreats); // Squares strongly protected by the enemy, either because they defend the // square with a pawn, or because they defend the square twice and we don't.