*Fix a bug in NearestGameObjectCheck.
--HG-- branch : trunk
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user