From e67b3bd51ce796fcc0b8f03b24bd6ccf62a0269c Mon Sep 17 00:00:00 2001 From: Fabian Fichter Date: Fri, 12 Oct 2018 00:11:25 +0200 Subject: [PATCH] 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 --- src/position.h | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) 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 -- 1.7.0.4