prevent crash if incorrect zone setup

This commit is contained in:
2024-04-19 22:42:35 +00:00
parent fac8c2002c
commit ff6a78b9af
2 changed files with 13 additions and 3 deletions

View File

@@ -27,7 +27,11 @@ export default class Game {
}
this.initLastSentLocations();
this.zone.reset()
this.zone.start()
//If the zone cannot be setup, reset everything
if(!this.zone.start()) {
this.setState(GameState.SETUP);
return;
}
}
if (newState != GameState.PLAYING) {
this.zone.reset();