From 52f2a69c38e317bc500dd418b8a2c967f3fc543e Mon Sep 17 00:00:00 2001 From: FauziAkram Date: Sun, 20 Dec 2020 17:50:34 +0200 Subject: [PATCH 1/2] Bench: 4338972 Bench: 4338972 --- src/evaluate.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index dd5d23b253d..a46c4979ae3 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -791,12 +791,14 @@ namespace { unsafeSquares &= attackedBy[Them][ALL_PIECES] | pos.pieces(Them); // If there are no enemy pieces or attacks on passed pawn span, assign a big bonus. + // Or if there is some, but they are all attacked by our pawns, assign a bit smaller bonus. // Otherwise assign a smaller bonus if the path to queen is not attacked // and even smaller bonus if it is attacked but block square is not. - int k = !unsafeSquares ? 35 : - !(unsafeSquares & squaresToQueen) ? 20 : - !(unsafeSquares & blockSq) ? 9 : - 0 ; + + int k = !unsafeSquares ? 36 : + !(unsafeSquares & ~attackedBy[Us][PAWN]) ? 30 : + !(unsafeSquares & squaresToQueen) ? 17 : + !(unsafeSquares & blockSq) ? 7 : // Assign a larger bonus if the block square is defended if ((pos.pieces(Us) & bb) || (attackedBy[Us][ALL_PIECES] & blockSq)) From 7a5b99982aa9c29bac877276f92c262e99349186 Mon Sep 17 00:00:00 2001 From: FauziAkram Date: Sun, 20 Dec 2020 18:12:11 +0200 Subject: [PATCH 2/2] Bench: 4338972 Bench: 4338972 --- src/evaluate.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index a46c4979ae3..abd1a034227 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -799,6 +799,7 @@ namespace { !(unsafeSquares & ~attackedBy[Us][PAWN]) ? 30 : !(unsafeSquares & squaresToQueen) ? 17 : !(unsafeSquares & blockSq) ? 7 : + 0 ; // Assign a larger bonus if the block square is defended if ((pos.pieces(Us) & bb) || (attackedBy[Us][ALL_PIECES] & blockSq))