Core/AreaTriggers: Optimize target searching
Port From (https://github.com/TrinityCore/TrinityCore/commit/23144d0665504e2e24ee790e900bb8de0df4aa08)
This commit is contained in:
@@ -189,11 +189,11 @@ namespace Scripts.Spells.Holiday
|
||||
bool foundSomeone = false;
|
||||
// For nearby players, check if they have the same aura. If so, cast Romantic Picnic (45123)
|
||||
// required by achievement and "hearts" visual
|
||||
List<Player> playerList = new List<Player>();
|
||||
List<Unit> playerList = new List<Unit>();
|
||||
AnyPlayerInObjectRangeCheck checker = new AnyPlayerInObjectRangeCheck(target, SharedConst.InteractionDistance * 2);
|
||||
var searcher = new PlayerListSearcher(target, playerList, checker);
|
||||
Cell.VisitWorldObjects(target, searcher, SharedConst.InteractionDistance * 2);
|
||||
foreach (var player in playerList)
|
||||
foreach (Player player in playerList)
|
||||
{
|
||||
if (player != target && player.HasAura(GetId())) // && player.GetStandState() == UNIT_STAND_STATE_SIT)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user