X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=2fb0e55a9d47b08ed61fa7319aca386200140390;hp=9d98a63b6cd15afb6badaf708423c9dd5881e471;hb=2ac35027d5900a641559fae7b22a994f8b4c2d72;hpb=d2d4e85f25061aacd65a8b458b79cad15b74a5bb diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 9d98a63b..2fb0e55a 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -337,9 +337,8 @@ namespace { else if (bb &= b & ~pos.pieces(Us)) score += Outpost[Pt == BISHOP][bool(attackedBy[Us][PAWN] & bb)]; - // Bonus when behind a pawn - if ( relative_rank(Us, s) < RANK_5 - && (pos.pieces(PAWN) & (s + pawn_push(Us)))) + // Knight and Bishop bonus for being right behind a pawn + if (shift(pos.pieces(PAWN)) & s) score += MinorBehindPawn; // Penalty if the piece is far from the king @@ -561,9 +560,9 @@ namespace { score += Hanging * popcount(weak & ~attackedBy[Them][ALL_PIECES]); - // Bonus for overload (non-pawn enemies attacked and defended exactly once) + // Bonus for overload (non-pawn enemies attacked once or more and defended exactly once) b = nonPawnEnemies - & attackedBy[Us][ALL_PIECES] & ~attackedBy2[Us] + & attackedBy[Us][ALL_PIECES] & attackedBy[Them][ALL_PIECES] & ~attackedBy2[Them]; score += Overload * popcount(b); }