diff options
| author | Treeston <treeston.mmoc@gmail.com> | 2016-08-21 11:07:38 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2016-08-21 11:07:38 +0200 |
| commit | 6f85422f0b7221dd38eaa70320b8a28b5fe7a2ef (patch) | |
| tree | 75e1fbb2f6daef9e288718c2da88cca9fd5007d4 /src/server/game/Spells/Spell.cpp | |
| parent | 061b62a97dc9fbc1687de48404ed8e56e4fd1f5d (diff) | |
Core/Spells: Fix orientation- and targeting-related issues if the creature isn't currently engaged in combat. (#17120)
Also disable spell focus system for vehicle control auras.
Closes #16572
Closes #17016
Diffstat (limited to 'src/server/game/Spells/Spell.cpp')
| -rw-r--r-- | src/server/game/Spells/Spell.cpp | 32 |
1 files changed, 4 insertions, 28 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 9545b957c57..45dcb6d9d17 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -603,8 +603,6 @@ m_caster((info->HasAttribute(SPELL_ATTR6_CAST_BY_CHARMER) && caster->GetCharmerO //Auto Shot & Shoot (wand) m_autoRepeat = m_spellInfo->IsAutoRepeatRangedSpell(); - m_isDelayedInstantCast = false; - m_runesState = 0; m_powerCost = 0; // setup to correct value in Spell::prepare, must not be used before. m_casttime = 0; // setup to correct value in Spell::prepare, must not be used before. @@ -2977,21 +2975,9 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered if (!(IsNextMeleeSwingSpell() || IsAutoRepeat() || _triggeredCastFlags & TRIGGERED_IGNORE_SET_FACING)) { if (m_targets.GetObjectTarget() && m_caster != m_targets.GetObjectTarget()) - { - if (m_caster->ToCreature()->FocusTarget(this, m_targets.GetObjectTarget())) - { - m_isDelayedInstantCast = true; - m_timer = 100; // 100ms delay ensures client has updated creature orientation when cast goes off - } - } + m_caster->ToCreature()->FocusTarget(this, m_targets.GetObjectTarget()); else if (m_spellInfo->HasAttribute(SPELL_ATTR5_DONT_TURN_DURING_CAST)) - { - if (m_caster->ToCreature()->FocusTarget(this, nullptr)) - { - m_isDelayedInstantCast = true; - m_timer = 100; - } - } + m_caster->ToCreature()->FocusTarget(this, nullptr); } // don't allow channeled spells / spells with cast time to be cast while moving @@ -3034,14 +3020,13 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered } m_caster->SetCurrentCastSpell(this); - if (!m_isDelayedInstantCast) - SendSpellStart(); + SendSpellStart(); if (!(_triggeredCastFlags & TRIGGERED_IGNORE_GCD)) TriggerGlobalCooldown(); //item: first cast may destroy item and second cast causes crash - if (!m_casttime && !m_isDelayedInstantCast && !m_spellInfo->StartRecoveryTime && !m_castItemGUID && GetCurrentContainer() == CURRENT_GENERIC_SPELL) + if (!m_casttime && !m_spellInfo->StartRecoveryTime && !m_castItemGUID && GetCurrentContainer() == CURRENT_GENERIC_SPELL) cast(true); } } @@ -3050,9 +3035,6 @@ void Spell::cancel() { if (m_spellState == SPELL_STATE_FINISHED) return; - // delayed instant casts are used for client-side visual orientation; they are treated as instant for all intents and purposes server-side, and thus cannot be interrupted by another cast - if (m_isDelayedInstantCast) - return; uint32 oldState = m_spellState; m_spellState = SPELL_STATE_FINISHED; @@ -3122,9 +3104,6 @@ void Spell::cast(bool skipCheck) return; } - if (m_isDelayedInstantCast) - SendSpellStart(); - if (Player* playerCaster = m_caster->ToPlayer()) { // now that we've done the basic check, now run the scripts @@ -3209,10 +3188,7 @@ void Spell::cast(bool skipCheck) if (m_caster->GetTypeId() == TYPEID_UNIT && !m_caster->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED)) if (!m_spellInfo->HasAttribute(SPELL_ATTR5_DONT_TURN_DURING_CAST)) if (WorldObject* objTarget = m_targets.GetObjectTarget()) - { m_caster->SetInFront(objTarget); - m_caster->SetFacingToObject(objTarget); - } SelectSpellTargets(); |
