From: Fabian Fichter Date: Thu, 11 Oct 2018 22:11:25 +0000 (+0200) Subject: Fix winning condition for racing kings (close #9) X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=e67b3bd51ce796fcc0b8f03b24bd6ccf62a0269c;p=fairystockfish.git Fix winning condition for racing kings (close #9) Correctly evaluate positions where both kings are on the back rank. racingkings STC LLR: 2.95 (-2.94,2.94) [-10.00,5.00] Total: 354 W: 144 L: 95 D: 115 http://35.161.250.236:6543/tests/view/5be9cb8e6e23db7639060c7d racingkings LTC LLR: 2.97 (-2.94,2.94) [-10.00,5.00] Total: 273 W: 110 L: 62 D: 101 http://35.161.250.236:6543/tests/view/5bea06106e23db7639060c80 --- diff --git a/src/position.h b/src/position.h index a993671..2c621b5 100644 --- a/src/position.h +++ b/src/position.h @@ -557,7 +557,8 @@ inline bool Position::is_variant_end(Value& result, int ply) const { && flag_move() && (capture_the_flag(sideToMove) & pieces(sideToMove, capture_the_flag_piece()))) { - result = mate_in(ply); + result = (capture_the_flag(~sideToMove) & pieces(~sideToMove, capture_the_flag_piece())) + && sideToMove == WHITE ? VALUE_DRAW : mate_in(ply); return true; } // nCheck