Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
If a UCI engine sends a PV when not supposed to be in the thinking state
or pondering, then issue a warning.
  • Loading branch information
alwey committed Dec 31, 2021
commit f4585b73df8b2e76eb50bc0df59a632408d11ec2
8 changes: 7 additions & 1 deletion projects/lib/src/uciengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,13 @@ void UciEngine::parseInfo(const QVarLengthArray<QStringRef>& tokens,
eval->setPvNumber(tokens[0].toString().toInt());
break;
case InfoPv:
eval->setPv(m_useDirectPv ? directPv(tokens) : sanPv(tokens));
if (this->state() == Thinking
|| (this->state() == Observing && pondering()))
eval->setPv(m_useDirectPv ? directPv(tokens) : sanPv(tokens));
else if (this->state() != FinishingGame)
qWarning("Unexpected PV from %s: %s",
qUtf8Printable(name()),
qUtf8Printable(directPv(tokens)));
break;
case InfoScore:
{
Expand Down