aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWyrserth <wyrserth@protonmail.com>2019-06-18 10:34:08 +0200
committerGiacomo Pozzoni <giacomopoz@gmail.com>2019-06-18 10:34:08 +0200
commit015870bfe1d3ec57c4505072f087b88fe63662b5 (patch)
tree2290e066bae13b0c5338c852b0612f9bcf73ebef
parentcb8b1069c415e22ddbc2c0e54d5fd2a39c2c411b (diff)
Core/Misc: don't allow FindNearestCreature() and FindNearestGameObject() searches to return the entity that called them. (#23437)
Closes #23334.
-rw-r--r--src/server/game/Grids/Notifiers/GridNotifiers.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h
index f3bb4a14b12..0c46383e4a9 100644
--- a/src/server/game/Grids/Notifiers/GridNotifiers.h
+++ b/src/server/game/Grids/Notifiers/GridNotifiers.h
@@ -740,7 +740,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;
@@ -1278,7 +1278,7 @@ namespace Trinity
bool operator()(Creature* u)
{
- if (u->getDeathState() != DEAD && u->GetEntry() == i_entry && u->IsAlive() == i_alive && i_obj.IsWithinDistInMap(u, i_range))
+ if (u->getDeathState() != DEAD && u->GetEntry() == i_entry && u->IsAlive() == i_alive && u->GetGUID() != i_obj.GetGUID() && i_obj.IsWithinDistInMap(u, i_range))
{
i_range = i_obj.GetDistance(u); // use found unit range as new range limit for next check
return true;