diff options
author | ariel- <ariel-@users.noreply.github.com> | 2017-01-22 02:24:48 -0300 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2019-06-15 18:41:09 +0200 |
commit | 6135ee1ad7052992093ad392347f4ef2c2ef4cf6 (patch) | |
tree | 677452523928f7aad07dcdf865899b80c2078aa5 /src | |
parent | 6e3ce8cf8b51427ecf61ee45099abab12330269b (diff) |
Core/Creature: don't allow turning if spell would cancel due to turning to face target
Closes #18549
(cherrypicked from 6b55faba065cd5d0519fb6e3e070a4a41d305cca)
(cherrypicked from c83092a1276f522cf11f5e3ceded7306e8fdb937)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Entities/Creature/Creature.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 937ca3a50e4..685afd1232d 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -2887,8 +2887,10 @@ void Creature::FocusTarget(Spell const* focusSpell, WorldObject const* target) if (m_focusSpell) return; + SpellInfo const* spellInfo = focusSpell->GetSpellInfo(); + // don't use spell focus for vehicle spells - if (focusSpell->GetSpellInfo()->HasAura(DIFFICULTY_NONE, SPELL_AURA_CONTROL_VEHICLE)) + if (spellInfo->HasAura(DIFFICULTY_NONE, SPELL_AURA_CONTROL_VEHICLE)) return; if ((!target || target == this) && !focusSpell->GetCastTime()) // instant cast, untargeted (or self-targeted) spell doesn't need any facing updates @@ -2911,14 +2913,14 @@ void Creature::FocusTarget(Spell const* focusSpell, WorldObject const* target) if ( // 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 - focusSpell->GetSpellInfo()->GetSpellVisual() + spellInfo->GetSpellVisual() ) && ( !focusSpell->GetCastTime() || // if the spell is instant cast - focusSpell->GetSpellInfo()->HasAttribute(SPELL_ATTR5_DONT_TURN_DURING_CAST) // client gets confused if we attempt to turn at the regularly scheduled update packet + spellInfo->HasAttribute(SPELL_ATTR5_DONT_TURN_DURING_CAST) // client gets confused if we attempt to turn at the regularly scheduled update packet ) ) { - std::list<Player*> playersNearby; + std::vector<Player*> playersNearby; GetPlayerListInGrid(playersNearby, GetVisibilityRange()); for (Player* player : playersNearby) { @@ -2929,7 +2931,7 @@ void Creature::FocusTarget(Spell const* focusSpell, WorldObject const* target) } } - bool canTurnDuringCast = !focusSpell->GetSpellInfo()->HasAttribute(SPELL_ATTR5_DONT_TURN_DURING_CAST); + bool const canTurnDuringCast = !spellInfo->HasAttribute(SPELL_ATTR5_DONT_TURN_DURING_CAST); // Face the target - we need to do this before the unit state is modified for no-turn spells if (target) SetFacingToObject(target); |