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,11 +74,13 @@ export class World {
|
||||||
|
|
||||||
this.players.remove(entity.entityId);
|
this.players.remove(entity.entityId);
|
||||||
|
|
||||||
|
if (!entity.isDead) {
|
||||||
const writer = createWriter(Endian.BE);
|
const writer = createWriter(Endian.BE);
|
||||||
entity.toSave(writer);
|
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);
|
||||||
this.sendToNearbyClients(entity, new PacketDestroyEntity(entity.entityId).writeData());
|
this.sendToNearbyClients(entity, new PacketDestroyEntity(entity.entityId).writeData());
|
||||||
|
|
Loading…
Reference in a new issue