From cd44ac3fa54f2025f91a264543cd2aca08dddd7a Mon Sep 17 00:00:00 2001 From: Fabian Fichter Date: Tue, 24 Nov 2020 23:32:59 +0100 Subject: [PATCH] Consider gating pieces in SEE Consider king captures as illegal if attacked by gating piece. seirawan STC LLR: -1.04 (-2.94,2.94) [0.00,10.00] Total: 9842 W: 3420 L: 3320 D: 3102 http://www.variantfishtest.org:6543/tests/view/5fb8369c6e23db221d9e9400 seirawan LTC LLR: 2.96 (-2.94,2.94) [-10.00,5.00] Total: 1483 W: 494 L: 453 D: 536 http://www.variantfishtest.org:6543/tests/view/5fb90fbf6e23db221d9e9407 Closes #210. --- src/position.cpp | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/position.cpp b/src/position.cpp index a39fc60..815ed83 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -1969,7 +1969,7 @@ bool Position::see_ge(Move m, Value threshold) const { else // KING // If we "capture" with the king but opponent still has attackers, // reverse the result. - return (attackers & ~pieces(stm)) ? res ^ 1 : res; + return (attackers & ~pieces(stm)) || (is_gating(m) && ~stm == sideToMove && (attacks_from(stm, gating_type(m), from) & to)) ? res ^ 1 : res; } return bool(res); -- 1.7.0.4