From 63eccbde8584ba631374a6cf7b7cd9fca059dd63 Mon Sep 17 00:00:00 2001 From: megamage Date: Thu, 21 May 2009 17:58:43 -0500 Subject: *Fix a bug in NearestGameObjectCheck. --HG-- branch : trunk --- src/game/GridNotifiers.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/game') 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: -- cgit v1.2.3