diff options
author | megamage <none@none> | 2009-08-07 16:12:50 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-08-07 16:12:50 -0500 |
commit | 0f7b23070fd61ac4afd65d415bd56876d3716ea1 (patch) | |
tree | a99ec14cb86d8b5f670a0a2efc0dc0f136b6a7c6 /src | |
parent | 74357a8971c45851f5b00415fbc52b8bb168c0b7 (diff) |
*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
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Spell.cpp | 2 | ||||
-rw-r--r-- | src/game/Unit.cpp | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 21d7cf0250e..9b45eac6b2d 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -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 diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 5c666f3778f..d6abba40659 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -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); |