Lower bonus for non-queen breakthroughs
authorFabian Fichter <ianfab@users.noreply.github.com>
Sun, 13 Dec 2020 12:22:28 +0000 (13:22 +0100)
committerFabian Fichter <ianfab@users.noreply.github.com>
Sun, 13 Dec 2020 12:22:28 +0000 (13:22 +0100)
horde STC
LLR: 2.95 (-2.94,2.94) [0.00,10.00]
Total: 1498 W: 804 L: 681 D: 13
http://www.variantfishtest.org:6543/tests/view/5fd4c8d96e23db221d9e950b

horde LTC
LLR: 2.95 (-2.94,2.94) [0.00,10.00]
Total: 3282 W: 1703 L: 1554 D: 25
http://www.variantfishtest.org:6543/tests/view/5fd512666e23db221d9e951b

src/evaluate.cpp

index e038503..8f1ffba 100644 (file)
@@ -1185,8 +1185,9 @@ namespace {
             {
                 // Add a bonus according to how close we are to breaking through the pawn wall
                 int dist = 8;
-                if ((attackedBy[Us][QUEEN] | attackedBy[Us][ROOK]) & rank_bb(relative_rank(Us, pos.max_rank(), pos.max_rank())))
-                    dist = 0;
+                Bitboard breakthroughs = attackedBy[Us][ALL_PIECES] & rank_bb(relative_rank(Us, pos.max_rank(), pos.max_rank()));
+                if (breakthroughs)
+                    dist = attackedBy[Us][QUEEN] & breakthroughs ? 0 : 1;
                 else for (File f = FILE_A; f <= pos.max_file(); ++f)
                 {
                     int pawns = popcount(pos.pieces(Them, PAWN) & file_bb(f));