1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-29 16:23:09 +00:00

Small tweak in probe_dtz()

This commit is contained in:
Marco Costalba 2016-05-24 13:03:04 +02:00
parent 09139d87cb
commit 23a548feaa

View file

@ -1486,12 +1486,7 @@ int Tablebases::probe_dtz(Position& pos, ProbeState* result)
int dtz = probe_dtz_table(pos, wdl, result); // Probe the table!
if (*result != CHANGE_STM)
{
if (wdl == WDLCursedLoss || wdl == WDLCursedWin)
dtz += 100;
return wdl > WDLDraw ? dtz : -dtz;
}
return (dtz + 100 * (wdl == WDLCursedLoss || wdl == WDLCursedWin)) * sign_of(wdl);
// DTZ stores results for the other side, so we need to do a 1-ply search and
// find the winning move that minimizes DTZ.