mirror of
https://github.com/tobspr/shapez.io.git
synced 2024-10-27 20:34:29 +00:00
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();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user