部分解决游戏进行中新建游戏时崩溃的问题

This commit is contained in:
CalciteM Team 2019-08-31 11:11:55 +08:00
parent 1809014e09
commit d311183bf4
2 changed files with 7 additions and 2 deletions

View File

@ -132,9 +132,10 @@ void AiThread::run()
QTimer::singleShot(EMIT_COMMAND_DELAY, this, &AiThread::emitCommand);
} else {
strCommand = ai_ab.bestMove();
qDebug() << "Computer:" << strCommand << "\n";
if (strcmp(strCommand, "error!") != 0)
if (strCommand && strcmp(strCommand, "error!") != 0) {
qDebug() << "Computer:" << strCommand << "\n";
QTimer::singleShot(EMIT_COMMAND_DELAY, this, &AiThread::emitCommand);
}
}
#ifdef DEBUG_MODE

View File

@ -1113,6 +1113,10 @@ const char* NineChessAi_ab::bestMove()
#endif
//qDebug() << "sizeof(Node) = " << sizeof(Node);
if (bestMoves.empty()) {
return nullptr;
}
return move2string(bestMoves[0]->move);
}