diff --git a/src/game/Object/Unit.cpp b/src/game/Object/Unit.cpp index 70c08ea2..28782e86 100644 --- a/src/game/Object/Unit.cpp +++ b/src/game/Object/Unit.cpp @@ -3068,7 +3068,9 @@ void Unit::SetCurrentCastedSpell(Spell* pSpell) m_currentSpells[CSpellType] = pSpell; pSpell->SetReferencedFromCurrent(true); - pSpell->m_selfContainer = &(m_currentSpells[pSpell->GetCurrentContainer()]); + pSpell->SetSelfContainer(&(m_currentSpells[pSpell->GetCurrentContainer()])); + // previous and faulty version of the following code. If the above proves to work, then delete this instruction + // pSpell->m_selfContainer = &(m_currentSpells[pSpell->GetCurrentContainer()]); } void Unit::InterruptSpell(CurrentSpellTypes spellType, bool withDelayed) diff --git a/src/game/WorldHandlers/Spell.h b/src/game/WorldHandlers/Spell.h index 3cdc9ff0..6e5c6eba 100644 --- a/src/game/WorldHandlers/Spell.h +++ b/src/game/WorldHandlers/Spell.h @@ -439,6 +439,9 @@ class Spell typedef std::list UnitList; + void SetSelfContainer(Spell** pCurrentContainer) { m_selfContainer = pCurrentContainer; } + Spell** GetSelfContainer() { return m_selfContainer; } + protected: bool HasGlobalCooldown(); void TriggerGlobalCooldown();