diff options
| author | megamage <none@none> | 2008-11-14 17:42:00 -0600 |
|---|---|---|
| committer | megamage <none@none> | 2008-11-14 17:42:00 -0600 |
| commit | 053b671cb5481dacc85fe192ceea937462361948 (patch) | |
| tree | 846406cce519bc8a11b9f4d48b0686974615a53f /src/game/Spell.cpp | |
| parent | bfa9e7516177af9e13391a09d4e1356c74a4c2ba (diff) | |
[svn] Add UNIT_STAT_CASTING, and use it to update attack timer as test.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Spell.cpp')
| -rw-r--r-- | src/game/Spell.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index fdedd0e7d78..5d9c81ea3fc 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -2142,6 +2142,7 @@ void Spell::prepare(SpellCastTargets * targets, Aura* triggeredByAura) m_caster->SetCurrentCastedSpell( this ); m_selfContainer = &(m_caster->m_currentSpells[GetCurrentContainer()]); SendSpellStart(); + m_caster->addUnitState(UNIT_STAT_CASTING); } } @@ -2666,14 +2667,17 @@ void Spell::finish(bool ok) if(!m_caster) return; - if(IsChanneledSpell(m_spellInfo)) - m_caster->UpdateInterruptMask(); - if(m_spellState == SPELL_STATE_FINISHED) return; m_spellState = SPELL_STATE_FINISHED; + if(IsChanneledSpell(m_spellInfo)) + m_caster->UpdateInterruptMask(); + + if(!m_caster->IsNonMeleeSpellCasted(false, false, true)) + m_caster->clearUnitState(UNIT_STAT_CASTING); + //remove spell mods if (m_caster->GetTypeId() == TYPEID_PLAYER) ((Player*)m_caster)->RemoveSpellMods(this); @@ -2707,12 +2711,12 @@ void Spell::finish(bool ok) } } - if (IsMeleeAttackResetSpell()) + /*if (IsMeleeAttackResetSpell()) { m_caster->resetAttackTimer(BASE_ATTACK); if(m_caster->haveOffhandWeapon()) m_caster->resetAttackTimer(OFF_ATTACK); - } + }*/ /*if (IsRangedAttackResetSpell()) m_caster->resetAttackTimer(RANGED_ATTACK);*/ |
