mirror of
https://github.com/sockspls/badfish
synced 2025-05-03 01:59:36 +00:00
Hanlde mate position in dtz probe
Stick to the original code behaviour.
This commit is contained in:
parent
36d6a1fd0a
commit
f852b0ed8f
1 changed files with 4 additions and 1 deletions
|
@ -1520,7 +1520,10 @@ int Tablebases::probe_dtz(Position& pos, ProbeState* result)
|
||||||
minDTZ = dtz;
|
minDTZ = dtz;
|
||||||
}
|
}
|
||||||
|
|
||||||
return minDTZ + sign_of(minDTZ); // Convert result from 1-ply search
|
// Convert result from 1-ply search. Special handle a mate position, when
|
||||||
|
// there are no legal moves. Return value is somewhat arbitrary, so stick
|
||||||
|
// to the original TB code that returns -1 in this case.
|
||||||
|
return minDTZ == 0xFFFF ? - 1 : minDTZ + sign_of(minDTZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check whether there has been at least one repetition of positions
|
// Check whether there has been at least one repetition of positions
|
||||||
|
|
Loading…
Add table
Reference in a new issue