mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 08:28:32 +01:00
*Do not let spell (stun/confuse/fear) interrupt itself (cause crash).
--HG-- branch : trunk
This commit is contained in:
@@ -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; }
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user