diff options
| author | megamage <none@none> | 2009-05-21 17:58:43 -0500 |
|---|---|---|
| committer | megamage <none@none> | 2009-05-21 17:58:43 -0500 |
| commit | 63eccbde8584ba631374a6cf7b7cd9fca059dd63 (patch) | |
| tree | b0c175542bc457c60e71131750015e4b94859002 | |
| parent | 2280ca66b81aa7c856807d298d1cf2d84355a94e (diff) | |
*Fix a bug in NearestGameObjectCheck.
--HG--
branch : trunk
| -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: |
