Merge remote-tracking branch 'origin/main' into dCinema

This commit is contained in:
wincent
2023-11-11 14:20:13 +01:00
11 changed files with 210 additions and 145 deletions

View File

@@ -938,7 +938,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());
}