From 6a6a7d2b221a5b1a53034f3aa439c4f6d28a1395 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Sat, 21 May 2016 19:55:32 +0200 Subject: [PATCH] Make probe_dtz_table() return correct dtz --- src/syzygy/tbprobe.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/syzygy/tbprobe.cpp b/src/syzygy/tbprobe.cpp index 829ff40b..50620bb2 100644 --- a/src/syzygy/tbprobe.cpp +++ b/src/syzygy/tbprobe.cpp @@ -656,7 +656,7 @@ int map_score(DTZEntry* entry, File f, int value, WDLScore wdl) || wdl == WDLCursedLoss) value *= 2; - return value; + return value + 1; } // Compute a unique index out of a position and use it to probe the TB file. To @@ -1465,7 +1465,7 @@ int Tablebases::probe_dtz(Position& pos, ProbeState* result) || *result == WIN_PAWN_MOVE) return wdl == WDLWin ? 1 : 101; // DTZ scores for immediate win or cursed win - int dtz = 1 + probe_dtz_table(pos, wdl, result); // Probe the table! + int dtz = probe_dtz_table(pos, wdl, result); // Probe the table! if (*result != CHANGE_STM) {