FIX: going back a 2nd time to SelectCharacterScene used to crash the game

This commit is contained in:
kharhamel
2020-12-16 15:09:58 +01:00
parent f5e77ad749
commit eb88db92be
6 changed files with 32 additions and 19 deletions
@@ -116,13 +116,14 @@ export class SelectCharacterScene extends ResizableScene {
}
private nextScene(): void {
this.scene.sleep(SelectCharacterSceneName);
this.scene.stop(SelectCharacterSceneName);
if (this.selectedPlayer !== null) {
gameManager.setCharacterLayers([this.selectedPlayer.texture.key]);
gameManager.tryResumingGame(this, EnableCameraSceneName);
} else {
this.scene.run(CustomizeSceneName);
}
this.scene.remove(SelectCharacterSceneName);
}
createCurrentPlayer(): void {