From 2280b46616702e07cfd06eae205c1a80fda9d2aa Mon Sep 17 00:00:00 2001 From: Fabian Fichter Date: Sun, 10 Nov 2019 17:07:43 +0100 Subject: [PATCH] Fix attackers calculation for xiangqi generals xiangqi LLR: 1.77 (-2.94,2.94) [0.00,10.00] Total: 1000 W: 330 L: 274 D: 396 --- src/position.cpp | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/src/position.cpp b/src/position.cpp index 7e86ba8..5dd265d 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -774,6 +774,9 @@ Bitboard Position::attackers_to(Square s, Bitboard occupied, Color c) const { b |= pieces(c, FERS) & gates(c) & fers_sq; } + if (var->xiangqiGeneral) + b ^= b & pieces(KING) & ~PseudoAttacks[~c][WAZIR][s]; + return b; } -- 1.7.0.4