Only save player data on entity remove if the player is not dead.
This commit is contained in:
parent
1a08b5e991
commit
a5910abd86
1 changed files with 5 additions and 3 deletions
|
@ -74,10 +74,12 @@ export class World {
|
||||||
|
|
||||||
this.players.remove(entity.entityId);
|
this.players.remove(entity.entityId);
|
||||||
|
|
||||||
const writer = createWriter(Endian.BE);
|
if (!entity.isDead) {
|
||||||
entity.toSave(writer);
|
const writer = createWriter(Endian.BE);
|
||||||
|
entity.toSave(writer);
|
||||||
|
|
||||||
this.saveManager.writePlayerSaveToDisk(entity.username, writer);
|
this.saveManager.writePlayerSaveToDisk(entity.username, writer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.entites.remove(entity.entityId);
|
this.entites.remove(entity.entityId);
|
||||||
|
|
Loading…
Reference in a new issue