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

@@ -19,7 +19,7 @@ float DistanceValue::Calculate()
return 0.0f;
WorldObject* obj = loot.GetWorldObject(bot);
if (!obj)
if (!obj || !obj->IsInWorld())
return 0.0f;
return sServerFacade->GetDistance2d(botAI->GetBot(), obj);