mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 08:28:32 +01:00
Core/Objects: Fixed SelectNearestPlayer
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user