Skip to content

Commit

Permalink
WorldServer: Fix crash from deleting last char
Browse files Browse the repository at this point in the history
Revert "WorldServer: Fix crash from deleting last char"

This reverts commit d9adafa1fef0ac88ed2b3b8ca6b97c2421a603e2.

Update WorldServer.cpp
  • Loading branch information
EmosewaMC committed Nov 5, 2023
1 parent 1e2d560 commit e4a78bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dWorldServer/WorldServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand Down

0 comments on commit e4a78bd

Please sign in to comment.