From e35ba6d97fc844a60bf878715f4ec9a2eadcae90 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 14 Aug 2019 11:45:38 -0400 Subject: [PATCH] Core/Creature: don't allow turning if spell would cancel due to turning to face target Port TrinityCore Commit: https://github.com/TrinityCore/TrinityCore/commit/6135ee1ad7052992093ad392347f4ef2c2ef4cf6 --- Source/Game/Entities/Creature/Creature.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Source/Game/Entities/Creature/Creature.cs b/Source/Game/Entities/Creature/Creature.cs index df0c9e29b..ef7d9b7ad 100644 --- a/Source/Game/Entities/Creature/Creature.cs +++ b/Source/Game/Entities/Creature/Creature.cs @@ -2702,8 +2702,10 @@ namespace Game.Entities if (_focusSpell != null) return; + SpellInfo spellInfo = focusSpell.GetSpellInfo(); + // don't use spell focus for vehicle spells - if (focusSpell.GetSpellInfo().HasAura(Difficulty.None, AuraType.ControlVehicle)) + if (spellInfo.HasAura(Difficulty.None, AuraType.ControlVehicle)) return; if ((!target || target == this) && focusSpell.GetCastTime() == 0) // instant cast, untargeted (or self-targeted) spell doesn't need any facing updates @@ -2726,8 +2728,8 @@ namespace Game.Entities // here we determine if the (relatively expensive) forced update is worth it, or whether we can afford to wait until the scheduled update tick // only require instant update for spells that actually have a visual - if (focusSpell.GetSpellInfo().GetSpellVisual() != 0 && (focusSpell.GetCastTime() == 0 || // if the spell is instant cast - focusSpell.GetSpellInfo().HasAttribute(SpellAttr5.DontTurnDuringCast))) // client gets confused if we attempt to turn at the regularly scheduled update packet + 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 playersNearby = GetPlayerListInGrid(GetVisibilityRange()); foreach (var player in playersNearby)