diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/GridNotifiers.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/game/GridNotifiers.h b/src/game/GridNotifiers.h index 21ef9d0c81b..138807674ae 100644 --- a/src/game/GridNotifiers.h +++ b/src/game/GridNotifiers.h @@ -655,8 +655,12 @@ namespace Trinity NearestGameObjectCheck(WorldObject const& obj) : i_obj(obj), i_range(999) {} bool operator()(GameObject* go) { - i_range = i_obj.GetDistance(go); // use found GO range as new range limit for next check - return true; + if(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; + } + return false; } float GetLastRange() const { return i_range; } private: |