From 52a1faa9b4e7b0e6d07503f159b1556dc4bdad03 Mon Sep 17 00:00:00 2001 From: Fabian Fichter Date: Sun, 10 Nov 2019 17:05:07 +0100 Subject: [PATCH] Mitigate perpetual check blindness Improve handling of problematic positions in #49. --- src/position.cpp | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/position.cpp b/src/position.cpp index 1eed7d8..7e86ba8 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -1915,7 +1915,7 @@ bool Position::has_game_cycle(int ply) const { int end = captures_to_hand() ? st->pliesFromNull : std::min(st->rule50, st->pliesFromNull); - if (end < 3 || var->nFoldValue != VALUE_DRAW) + if (end < 3 || var->nFoldValue != VALUE_DRAW || var->perpetualCheckIllegal) return false; Key originalKey = st->key; -- 1.7.0.4