depth: Limit depth to 9 if change side when no way

This commit is contained in:
Calcitem 2021-04-10 09:47:34 +08:00
parent a0cee1bd06
commit 01f7ebe672
1 changed files with 7 additions and 0 deletions

View File

@ -561,6 +561,13 @@ Depth getSearchDepth(const Position *pos)
d = 4;
}
// WAR: Limit depth if change side when no way
if (!rule.isLoseButNotChangeSideWhenNoWay) {
if (d > 9) {
d = 9;
}
}
d += DEPTH_ADJUST;
d = d >= 1 ? d : 1;