Fix possible crash

This commit is contained in:
Yunfan Li
2024-05-06 21:56:02 +08:00
parent 7d27000de5
commit aaa33d8243
2 changed files with 3 additions and 3 deletions

View File

@@ -182,11 +182,11 @@ WorldObject* LootObject::GetWorldObject(Player* bot)
return nullptr;
}
Creature* creature = botAI->GetCreature(guid);
if (creature && creature->getDeathState() == DeathState::Corpse)
if (creature && creature->getDeathState() == DeathState::Corpse && creature->IsInWorld())
return creature;
GameObject* go = botAI->GetGameObject(guid);
if (go && go->isSpawned())
if (go && go->isSpawned() && go->IsInWorld())
return go;
return nullptr;