Fixed hard crash
This commit is contained in:
@ -38,7 +38,7 @@ void TicTacToeGame::onStart() {
|
||||
|
||||
useEvent([&](float_t delta) {
|
||||
// Only allow player input if it's their turn.
|
||||
if(winner != TIC_TAC_TOE_EMPTY) return;
|
||||
if(gameOver) return;
|
||||
|
||||
Camera *camera = getScene()->findComponent<Camera>();
|
||||
if(camera == nullptr) return;
|
||||
@ -96,7 +96,7 @@ void TicTacToeGame::onStart() {
|
||||
}
|
||||
|
||||
// Did game just end?
|
||||
if(ticTacToeIsGameOver(this->getBoard())) gameOver = true;
|
||||
gameOver = ticTacToeIsGameOver(this->getBoard());
|
||||
}, getScene()->eventSceneUpdate);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user