mirror of
https://github.com/sockspls/badfish
synced 2025-07-11 19:49:14 +00:00
Ensure printing UCI info in multi-pv case
After commit 94b1bbb68b
, in case available root moves are less than multiPV, we
could never reach condition:
PVIdx + 1 == multiPV
and as a consequence UCI output is not printed.
Fixed suggested by Joerg Oster.
No functional change.
This commit is contained in:
parent
29451de874
commit
1b69910865
1 changed files with 2 additions and 2 deletions
|
@ -301,7 +301,7 @@ namespace {
|
||||||
RootMoves[i].prevScore = RootMoves[i].score;
|
RootMoves[i].prevScore = RootMoves[i].score;
|
||||||
|
|
||||||
// MultiPV loop. We perform a full root search for each PV line
|
// MultiPV loop. We perform a full root search for each PV line
|
||||||
for (PVIdx = 0; PVIdx < multiPV && PVIdx < RootMoves.size() && !Signals.stop; ++PVIdx)
|
for (PVIdx = 0; PVIdx < std::min(multiPV, RootMoves.size()) && !Signals.stop; ++PVIdx)
|
||||||
{
|
{
|
||||||
// Reset aspiration window starting size
|
// Reset aspiration window starting size
|
||||||
if (depth >= 5)
|
if (depth >= 5)
|
||||||
|
@ -366,7 +366,7 @@ namespace {
|
||||||
// Sort the PV lines searched so far and update the GUI
|
// Sort the PV lines searched so far and update the GUI
|
||||||
std::stable_sort(RootMoves.begin(), RootMoves.begin() + PVIdx + 1);
|
std::stable_sort(RootMoves.begin(), RootMoves.begin() + PVIdx + 1);
|
||||||
|
|
||||||
if (PVIdx + 1 == multiPV || Time::now() - SearchTime > 3000)
|
if (PVIdx + 1 == std::min(multiPV, RootMoves.size()) || Time::now() - SearchTime > 3000)
|
||||||
sync_cout << uci_pv(pos, depth, alpha, beta) << sync_endl;
|
sync_cout << uci_pv(pos, depth, alpha, beta) << sync_endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue