aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWyrserth <wyrserth@protonmail.com>2019-06-18 10:34:08 +0200
committerShauren <shauren.trinity@gmail.com>2021-12-11 15:14:43 +0100
commit2bcfc6680c899ac4e94d71c7b864379ce69f9654 (patch)
tree1da37475139b01b9e41d93b42e8dfbe2ee1c7217 /src
parent468ff09c784a39eddc484d310755e27730b8161b (diff)
Core/Misc: don't allow FindNearestCreature() and FindNearestGameObject() searches to return the entity that called them. (#23437)
Closes #23334. (cherry picked from commit 015870bfe1d3ec57c4505072f087b88fe63662b5)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Grids/Notifiers/GridNotifiers.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h
index 04f1e5bcf05..5fee5746869 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 && i_obj.IsWithinDistInMap(go, i_range))
+ if (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;
@@ -1347,6 +1347,7 @@ namespace Trinity
if (u->getDeathState() != DEAD
&& u->GetEntry() == i_entry
&& u->IsAlive() == i_alive
+ && u->GetGUID() != i_obj.GetGUID()
&& i_obj.IsWithinDistInMap(u, i_range)
&& u->CheckPrivateObjectOwnerVisibility(&i_obj))
{