Only save player data on entity remove if the player is not dead.

This commit is contained in:
Holly Stubbs 2023-11-13 00:00:17 +00:00
parent 1a08b5e991
commit a5910abd86
Signed by: tgpholly
GPG key ID: B8583C4B7D18119E

View file

@ -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);