Entities/GO: FindNearestGameObject no longer incorrectly returns despawned gameobjects. Closes #23262.

(cherry picked from commit 4423ca99e7)
This commit is contained in:
Treeston
2019-07-11 23:31:46 +02:00
committed by Shauren
parent a3727f4409
commit 6de4c3cd72

View File

@@ -797,7 +797,7 @@ namespace Trinity
bool operator()(GameObject* go)
{
if (go->GetEntry() == i_entry && go->GetGUID() != i_obj.GetGUID() && i_obj.IsWithinDistInMap(go, i_range))
if (go->isSpawned() && go->GetEntry() == i_entry && go->GetGUID() != i_obj.GetGUID() && i_obj.IsWithinDistInMap(go, i_range))
{
i_range = i_obj.GetDistance(go); // use found GO range as new range limit for next check
return true;