diff options
author | megamage <none@none> | 2008-12-12 15:11:25 -0600 |
---|---|---|
committer | megamage <none@none> | 2008-12-12 15:11:25 -0600 |
commit | 041cbec7de90c4a2f627af95e6842328dfe646fe (patch) | |
tree | f18ef4a391adf5585bd722ac75c65c5aa1b6d8bd | |
parent | 7827d743a67798f0e5a38f5a2f2b5f65e5080f82 (diff) |
*Do not let spell (stun/confuse/fear) interrupt itself (cause crash).
--HG--
branch : trunk
-rw-r--r-- | src/game/Spell.h | 1 | ||||
-rw-r--r-- | src/game/Unit.cpp | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/game/Spell.h b/src/game/Spell.h index 3d9494f8a36..509d65ad87e 100644 --- a/src/game/Spell.h +++ b/src/game/Spell.h @@ -405,6 +405,7 @@ class Spell bool IsDeletable() const { return !m_referencedFromCurrentSpell && !m_executedCurrently; } void SetReferencedFromCurrent(bool yes) { m_referencedFromCurrentSpell = yes; } + bool IsInterruptable() const { return !m_executedCurrently; } void SetExecutedCurrently(bool yes) { m_executedCurrently = yes; } uint64 GetDelayStart() const { return m_delayStart; } void SetDelayStart(uint64 m_time) { m_delayStart = m_time; } diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index f7e02f1469c..c8cf1239587 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -3777,6 +3777,10 @@ void Unit::InterruptSpell(uint32 spellType, bool withDelayed) if(m_currentSpells[spellType] && (withDelayed || m_currentSpells[spellType]->getState() != SPELL_STATE_DELAYED) ) { + // for example, do not let self-stun aura interrupt itself + if(!m_currentSpells[spellType]->IsInterruptable()) + return; + // send autorepeat cancel message for autorepeat spells if (spellType == CURRENT_AUTOREPEAT_SPELL) { |