*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

View File

@@ -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: