[svn] Add UNIT_STAT_CASTING, and use it to update attack timer as test.

--HG--
branch : trunk
This commit is contained in:
megamage
2008-11-14 17:42:00 -06:00
parent bfa9e75161
commit 053b671cb5
3 changed files with 19 additions and 11 deletions

View File

@@ -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);*/