*Fix a bug introduced in 3874. This makes IsNonMeleeSpellCasted cannot correctly check if caster is casting.

*This fixes the bug that Heigan chases players when he is channelling.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-08-07 16:12:50 -05:00
parent 74357a8971
commit 0f7b23070f
2 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -3287,7 +3287,7 @@ void Spell::finish(bool ok)
if(IsChanneledSpell(m_spellInfo))
m_caster->UpdateInterruptMask();
if(!m_caster->IsNonMeleeSpellCasted(false, false, true))
if(m_caster->hasUnitState(UNIT_STAT_CASTING) && !m_caster->IsNonMeleeSpellCasted(false, false, true))
m_caster->clearUnitState(UNIT_STAT_CASTING);
// Unsummon summon as possessed creatures on spell cancel
+4 -2
View File
@@ -3502,15 +3502,17 @@ bool Unit::IsNonMeleeSpellCasted(bool withDelayed, bool skipChanneled, bool skip
if ( m_currentSpells[CURRENT_GENERIC_SPELL] &&
(m_currentSpells[CURRENT_GENERIC_SPELL]->getState() != SPELL_STATE_FINISHED) &&
(withDelayed || m_currentSpells[CURRENT_GENERIC_SPELL]->getState() != SPELL_STATE_DELAYED) )
{
if (!isAutoshoot || !(m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_NOT_RESET_AUTOSHOT))
return(true);
}
// channeled spells may be delayed, but they are still considered casted
else if ( !skipChanneled && m_currentSpells[CURRENT_CHANNELED_SPELL] &&
(m_currentSpells[CURRENT_CHANNELED_SPELL]->getState() != SPELL_STATE_FINISHED) )
{
if (!isAutoshoot || !(m_currentSpells[CURRENT_CHANNELED_SPELL]->m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_NOT_RESET_AUTOSHOT))
return(true);
}
// autorepeat spells may be finished or delayed, but they are still considered casted
else if ( !skipAutorepeat && m_currentSpells[CURRENT_AUTOREPEAT_SPELL] )
return(true);