From e4a78bd9afa5d130f5246d4891a0969fb649d054 Mon Sep 17 00:00:00 2001 From: David Markowitz Date: Sat, 4 Nov 2023 22:32:24 -0700 Subject: [PATCH] WorldServer: Fix crash from deleting last char Revert "WorldServer: Fix crash from deleting last char" This reverts commit d9adafa1fef0ac88ed2b3b8ca6b97c2421a603e2. Update WorldServer.cpp --- dWorldServer/WorldServer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dWorldServer/WorldServer.cpp b/dWorldServer/WorldServer.cpp index 58539cb0a..79dce1bf4 100644 --- a/dWorldServer/WorldServer.cpp +++ b/dWorldServer/WorldServer.cpp @@ -925,7 +925,7 @@ void HandlePacket(Packet* packet) { //We need to delete the entity first, otherwise the char list could delete it while it exists in the world! if (Game::server->GetZoneID() != 0) { auto user = UserManager::Instance()->GetUser(packet->systemAddress); - if (!user) return; + if (!user || !user->GetLastUsedChar()) return; Game::entityManager->DestroyEntity(user->GetLastUsedChar()->GetEntity()); }