mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-17 13:39:46 -04: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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user