console: 解决AI落子很快时棋盘打印不全的问题

This commit is contained in:
Calcitem 2020-09-05 01:01:39 +08:00
parent 23cae8364b
commit f75ce94dc3
2 changed files with 9 additions and 1 deletions

View File

@ -254,8 +254,9 @@ void AiThread::run()
strCommand = ai.nextMove();
if (strCommand && strcmp(strCommand, "error!") != 0) {
loggerDebug("Computer: %s\n\n", strCommand);
analyze();
emitCommand();
//analyze();
}
}
#ifdef OPENING_BOOK

View File

@ -949,6 +949,7 @@ bool GameController::command(const QString &cmd, bool update /* = true */)
}
if (update) {
//cout << position << endl;
playSound(soundType, position.side_to_move());
updateScence(&position);
}
@ -1081,6 +1082,12 @@ bool GameController::command(const QString &cmd, bool update /* = true */)
}
#endif // TRAINING_MODE
if (isAiPlayer[BLACK]) {
aiThread[BLACK]->analyze();
} else if (isAiPlayer[WHITE]) {
aiThread[WHITE]->analyze();
}
return true;
}