Core/AreaTriggers: Optimize target searching

Port From (https://github.com/TrinityCore/TrinityCore/commit/23144d0665504e2e24ee790e900bb8de0df4aa08)
This commit is contained in:
hondacrx
2021-02-04 12:12:54 -05:00
parent 0784e38a06
commit 0d1bfff206
9 changed files with 39 additions and 33 deletions
+2 -2
View File
@@ -2899,8 +2899,8 @@ namespace Game.Entities
if (spellInfo.GetSpellVisual() != 0 && (focusSpell.GetCastTime() == 0 || // if the spell is instant cast
spellInfo.HasAttribute(SpellAttr5.DontTurnDuringCast))) // client gets confused if we attempt to turn at the regularly scheduled update packet
{
List<Player> playersNearby = GetPlayerListInGrid(GetVisibilityRange());
foreach (var player in playersNearby)
List<Unit> playersNearby = GetPlayerListInGrid(GetVisibilityRange());
foreach (Player player in playersNearby)
{
// only update players that are known to the client (have already been created)
if (player.HaveAtClient(this))