Merge pull request #327 from hexagonhexagon/b-key-dev-fix
Fix issue where pressing B just after loading crashes the game.
This commit is contained in:
commit
4a56c3ccba
|
@ -105,14 +105,15 @@ export class HubGoals extends BasicSerializableObject {
|
|||
this.createNextGoal();
|
||||
|
||||
// Allow quickly switching goals in dev mode
|
||||
if (G_IS_DEV) {
|
||||
if (G_IS_DEV) {
|
||||
window.addEventListener("keydown", ev => {
|
||||
if (ev.key === "b") {
|
||||
// root is not guaranteed to exist within ~0.5s after loading in
|
||||
if (this.root && this.root.app && this.root.app.gameAnalytics) {
|
||||
this.onGoalCompleted();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Reference in New Issue