*Fix a bug in NearestGameObjectCheck.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-05-21 17:58:43 -05:00
parent 2280ca66b8
commit 63eccbde85
+4
View File
@@ -654,10 +654,14 @@ namespace Trinity
public: public:
NearestGameObjectCheck(WorldObject const& obj) : i_obj(obj), i_range(999) {} NearestGameObjectCheck(WorldObject const& obj) : i_obj(obj), i_range(999) {}
bool operator()(GameObject* go) bool operator()(GameObject* go)
{
if(i_obj.IsWithinDistInMap(go, i_range))
{ {
i_range = i_obj.GetDistance(go); // use found GO range as new range limit for next check i_range = i_obj.GetDistance(go); // use found GO range as new range limit for next check
return true; return true;
} }
return false;
}
float GetLastRange() const { return i_range; } float GetLastRange() const { return i_range; }
private: private:
WorldObject const& i_obj; WorldObject const& i_obj;