From 61aca8e5937890580e4c1f923ec0b5e5f3babe0a Mon Sep 17 00:00:00 2001 From: Fabian Fichter Date: Thu, 26 Sep 2019 20:46:32 +0200 Subject: [PATCH] Do not consider quiet moves as attacks Fix attack bitboard calculation for hoppelpoppel-style pieces. hoppelpoppel STC LLR: 2.94 (-2.94,2.94) [0.00,10.00] Total: 863 W: 335 L: 247 D: 281 http://35.161.250.236:6543/tests/view/5d8d0ab36e23db3768ec085c hoppelpoppel LTC LLR: 2.96 (-2.94,2.94) [0.00,10.00] Total: 717 W: 271 L: 187 D: 259 http://35.161.250.236:6543/tests/view/5d8d0d8f6e23db3768ec085f chess STC LLR: 3.00 (-2.94,2.94) [-10.00,5.00] Total: 1338 W: 317 L: 279 D: 742 http://35.161.250.236:6543/tests/view/5d8d16766e23db3768ec0861 --- src/evaluate.cpp | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 03f6d49..bf4ac36 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -297,8 +297,7 @@ namespace { // Find attacked squares, including x-ray attacks for bishops and rooks b = Pt == BISHOP ? attacks_bb(s, pos.pieces() ^ pos.pieces(QUEEN)) : Pt == ROOK ? attacks_bb< ROOK>(s, pos.pieces() ^ pos.pieces(QUEEN) ^ pos.pieces(Us, ROOK)) - : ( (pos.attacks_from(Us, Pt, s) & pos.pieces()) - | (pos.moves_from(Us, Pt, s) & ~pos.pieces())); + : pos.attacks_from(Us, Pt, s); // Restrict mobility to actual squares of board b &= pos.board_bb(); @@ -317,6 +316,9 @@ namespace { kingAttacksCount[Us] += popcount(b & attackedBy[Them][KING]); } + if (Pt > QUEEN) + b = (b & pos.pieces()) | (pos.moves_from(Us, Pt, s) & ~pos.pieces() & pos.board_bb()); + int mob = popcount(b & mobilityArea[Us]); if (Pt <= QUEEN) -- 1.7.0.4