Core/Objects: Fixed SelectNearestPlayer

This commit is contained in:
Shauren
2023-11-13 19:01:11 +01:00
parent 3f838a039c
commit dfc757acc3
2 changed files with 4 additions and 4 deletions

View File

@@ -2194,13 +2194,13 @@ GameObject* WorldObject::FindNearestGameObjectOfType(GameobjectTypes type, float
return go;
}
Player* WorldObject::SelectNearestPlayer(float distance) const
Player* WorldObject::SelectNearestPlayer(float range) const
{
Player* target = nullptr;
Trinity::NearestPlayerInObjectRangeCheck checker(this, distance);
Trinity::NearestPlayerInObjectRangeCheck checker(this, range);
Trinity::PlayerLastSearcher<Trinity::NearestPlayerInObjectRangeCheck> searcher(this, target, checker);
Cell::VisitGridObjects(this, searcher, distance);
Cell::VisitWorldObjects(this, searcher, range);
return target;
}

View File

@@ -625,7 +625,7 @@ class TC_GAME_API WorldObject : public Object, public WorldLocation
GameObject* FindNearestGameObjectWithOptions(float range, FindGameObjectOptions const& options) const;
GameObject* FindNearestUnspawnedGameObject(uint32 entry, float range) const;
GameObject* FindNearestGameObjectOfType(GameobjectTypes type, float range) const;
Player* SelectNearestPlayer(float distance) const;
Player* SelectNearestPlayer(float range) const;
virtual ObjectGuid GetCreatorGUID() const = 0;
virtual ObjectGuid GetOwnerGUID() const = 0;