部分解决游戏进行中新建游戏时崩溃的问题
This commit is contained in:
parent
1809014e09
commit
d311183bf4
|
@ -132,9 +132,10 @@ void AiThread::run()
|
||||||
QTimer::singleShot(EMIT_COMMAND_DELAY, this, &AiThread::emitCommand);
|
QTimer::singleShot(EMIT_COMMAND_DELAY, this, &AiThread::emitCommand);
|
||||||
} else {
|
} else {
|
||||||
strCommand = ai_ab.bestMove();
|
strCommand = ai_ab.bestMove();
|
||||||
qDebug() << "Computer:" << strCommand << "\n";
|
if (strCommand && strcmp(strCommand, "error!") != 0) {
|
||||||
if (strcmp(strCommand, "error!") != 0)
|
qDebug() << "Computer:" << strCommand << "\n";
|
||||||
QTimer::singleShot(EMIT_COMMAND_DELAY, this, &AiThread::emitCommand);
|
QTimer::singleShot(EMIT_COMMAND_DELAY, this, &AiThread::emitCommand);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_MODE
|
#ifdef DEBUG_MODE
|
||||||
|
|
|
@ -1113,6 +1113,10 @@ const char* NineChessAi_ab::bestMove()
|
||||||
#endif
|
#endif
|
||||||
//qDebug() << "sizeof(Node) = " << sizeof(Node);
|
//qDebug() << "sizeof(Node) = " << sizeof(Node);
|
||||||
|
|
||||||
|
if (bestMoves.empty()) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
return move2string(bestMoves[0]->move);
|
return move2string(bestMoves[0]->move);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue