Manage Local Storage customers player error
This commit is contained in:
parent
84de023d82
commit
f5dd5efc0e
2 changed files with 20 additions and 5 deletions
|
@ -106,7 +106,9 @@ export abstract class Character extends Container {
|
|||
});
|
||||
})
|
||||
// Needed, otherwise, animations are not handled correctly.
|
||||
this.scene.sys.updateList.add(sprite);
|
||||
if(this.scene) {
|
||||
this.scene.sys.updateList.add(sprite);
|
||||
}
|
||||
this.sprites.set(texture, sprite);
|
||||
}
|
||||
}
|
||||
|
@ -229,7 +231,9 @@ export abstract class Character extends Container {
|
|||
this.scene.events.removeListener('postupdate', this.postupdate.bind(this));
|
||||
}
|
||||
for (const sprite of this.sprites.values()) {
|
||||
this.scene.sys.updateList.remove(sprite);
|
||||
if(this.scene) {
|
||||
this.scene.sys.updateList.remove(sprite);
|
||||
}
|
||||
}
|
||||
super.destroy(fromScene);
|
||||
this.playerName.destroy();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue