From cea0b98edff2b4177f08d0101b07954126dbba69 Mon Sep 17 00:00:00 2001 From: David Markowitz <39972741+EmosewaMC@users.noreply.github.com> Date: Sun, 5 Nov 2023 01:00:19 -0800 Subject: [PATCH] WorldServer: Fix crash from deleting last char (#1254) 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 58539cb0..79dce1bf 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()); }