aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTreeston <treeston.mmoc@gmail.com>2019-07-11 23:31:46 +0200
committerShauren <shauren.trinity@gmail.com>2021-12-15 22:40:39 +0100
commit6de4c3cd72de1c7ae6e467b09ec181445b397338 (patch)
treef97cfca205b7ceb0698e9bbfaf0c8ad0537b0e72 /src
parenta3727f4409bd5c5994ac0ede9aa8947e8e570489 (diff)
Entities/GO: FindNearestGameObject no longer incorrectly returns despawned gameobjects. Closes #23262.
(cherry picked from commit 4423ca99e7f8c38ff83196134038a7790313ed7a)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Grids/Notifiers/GridNotifiers.h2
1 files changed, 1 insertions, 1 deletions
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;