From a5910abd86dccfef0bcf799b47953148b34f5f2e Mon Sep 17 00:00:00 2001 From: Holly Date: Mon, 13 Nov 2023 00:00:17 +0000 Subject: [PATCH] Only save player data on entity remove if the player is not dead. --- server/World.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/server/World.ts b/server/World.ts index 3ef13f2..2f2a9b5 100644 --- a/server/World.ts +++ b/server/World.ts @@ -74,10 +74,12 @@ export class World { this.players.remove(entity.entityId); - const writer = createWriter(Endian.BE); - entity.toSave(writer); + if (!entity.isDead) { + 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);