Spell class - Fix for inaccessible class data

Accessor functions created for protected member, m_selfContainer
This commit is contained in:
Charles A Edwards 2016-02-01 17:57:09 +00:00
parent f78f1e612a
commit 51ba36d565
2 changed files with 6 additions and 1 deletions

View File

@ -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)

View File

@ -439,6 +439,9 @@ class Spell
typedef std::list<Unit*> UnitList;
void SetSelfContainer(Spell** pCurrentContainer) { m_selfContainer = pCurrentContainer; }
Spell** GetSelfContainer() { return m_selfContainer; }
protected:
bool HasGlobalCooldown();
void TriggerGlobalCooldown();