Core/Misc: Add new function for selection nearest player in given distance
This commit is contained in:
@@ -1817,6 +1817,17 @@ Unit* Creature::SelectNearestTargetInAttackDistance(float dist) const
|
||||
return target;
|
||||
}
|
||||
|
||||
Player* Creature::SelectNearestPlayer(float distance) const
|
||||
{
|
||||
Player* target = NULL;
|
||||
|
||||
Trinity::NearestPlayerInObjectRangeCheck checker(this, distance);
|
||||
Trinity::PlayerLastSearcher<Trinity::NearestPlayerInObjectRangeCheck> searcher(this, target, checker);
|
||||
VisitNearbyObject(distance, searcher);
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
void Creature::SendAIReaction(AiReaction reactionType)
|
||||
{
|
||||
WorldPacket data(SMSG_AI_REACTION, 12);
|
||||
|
||||
Reference in New Issue
Block a user