qt: actionPiece: Support Auto Restart when game is over

This commit is contained in:
Calcitem 2021-01-29 23:09:50 +08:00
parent 739b360fc4
commit 9a1a69da13
1 changed files with 15 additions and 1 deletions

View File

@ -971,7 +971,21 @@ bool Game::actionPiece(QPointF p)
}
// If it's decided
else {
pauseThreads();
if (gameOptions.getAutoRestart()) {
saveScore();
gameReset();
gameStart();
if (isAiPlayer[BLACK]) {
setEngine(BLACK, true);
}
if (isAiPlayer[WHITE]) {
setEngine(WHITE, true);
}
} else {
pauseThreads();
}
}
}