From 46b5a5f0db5a65bc88da373f87b3280bcf0875e1 Mon Sep 17 00:00:00 2001 From: mstembera Date: Tue, 1 Sep 2015 17:36:03 -0700 Subject: [PATCH] Fix syzygy en passant issue v = value without ep capture being considered v1 = value of the ep capture The correct logic is: if without e.p. capture we are losing, and the value of e.p is either draw, or win or "loss, but 50 move rule saves us", then we should use the value of ep capture. Credit and thanks to syzygy1 and lantonov ! No functional change (except with syzygy bases) Resolves #415 Resolves #394 --- src/syzygy/tbprobe.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/syzygy/tbprobe.cpp b/src/syzygy/tbprobe.cpp index 646176a9..7bce67ea 100644 --- a/src/syzygy/tbprobe.cpp +++ b/src/syzygy/tbprobe.cpp @@ -624,7 +624,7 @@ int Tablebases::probe_dtz(Position& pos, int *success) if (v1 >= 0) v = v1; } else if (v < 0) { - if (v1 >= 0 || v1 < 100) + if (v1 >= 0 || v1 < -100) v = v1; } else if (v > 100) { if (v1 > 0) -- 2.39.2