From 6de4c3cd72de1c7ae6e467b09ec181445b397338 Mon Sep 17 00:00:00 2001 From: Treeston Date: Thu, 11 Jul 2019 23:31:46 +0200 Subject: Entities/GO: FindNearestGameObject no longer incorrectly returns despawned gameobjects. Closes #23262. (cherry picked from commit 4423ca99e7f8c38ff83196134038a7790313ed7a) --- src/server/game/Grids/Notifiers/GridNotifiers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h index eb99337e76f..7af3a4ae5a9 100644 --- a/src/server/game/Grids/Notifiers/GridNotifiers.h +++ b/src/server/game/Grids/Notifiers/GridNotifiers.h @@ -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; -- cgit v1.2.3