From 8925a28cf1efd365ef5af40c4d2c8d07a52cabc0 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Sat, 21 May 2016 21:49:22 +0200 Subject: [PATCH] Fix ep move for real this time --- src/syzygy/tbprobe.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/syzygy/tbprobe.cpp b/src/syzygy/tbprobe.cpp index 13cb9961..eab0ac02 100644 --- a/src/syzygy/tbprobe.cpp +++ b/src/syzygy/tbprobe.cpp @@ -1265,12 +1265,12 @@ WDLScore search(Position& pos, WDLScore alpha, WDLScore beta, ProbeState* result if (epValue != WDLScoreNone && !moveCount) value = epValue; - // Here alpha stores the best value out of the previous search - if (value > alpha) - return *result = (value == epValue ? ZEROING_MOVE : OK), value; + // Here alpha stores the best value of the ply-1 search, note that in case + // we only have a losing ep move alpha == value. + if (alpha >= value) + return *result = (alpha > WDLDraw || alpha == epValue ? ZEROING_MOVE : OK), alpha; - *result = alpha > WDLDraw ? ZEROING_MOVE : OK; - return alpha; + return *result = OK, value; } } // namespace