From 012d6fa865fb8083dcbeae9b04926527b3c19f4e Mon Sep 17 00:00:00 2001 From: megamage Date: Wed, 19 Aug 2009 16:52:51 -0500 Subject: [8381] Some refactoring work in Unit::m_currentSpells code. Author: VladimirMangos * Restrict access, use enum args, move some repeated code parts to function. * Make m_selfContainer set only part of Unit::SetCurrentCastedSpell --HG-- branch : trunk --- .../scripts/outland/black_temple/boss_reliquary_of_souls.cpp | 6 +++--- .../coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/bindings/scripts') diff --git a/src/bindings/scripts/scripts/outland/black_temple/boss_reliquary_of_souls.cpp b/src/bindings/scripts/scripts/outland/black_temple/boss_reliquary_of_souls.cpp index aa81259e451..c46f5479ae3 100644 --- a/src/bindings/scripts/scripts/outland/black_temple/boss_reliquary_of_souls.cpp +++ b/src/bindings/scripts/scripts/outland/black_temple/boss_reliquary_of_souls.cpp @@ -486,11 +486,11 @@ struct TRINITY_DLL_DECL boss_essence_of_desireAI : public ScriptedAI void SpellHit(Unit *caster, const SpellEntry *spell) { - if (m_creature->m_currentSpells[CURRENT_GENERIC_SPELL]) + if (m_creature->GetCurrentSpell(CURRENT_GENERIC_SPELL)) for(uint8 i = 0; i < 3; ++i) if (spell->Effect[i] == SPELL_EFFECT_INTERRUPT_CAST) - if (m_creature->m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->Id == SPELL_SOUL_SHOCK - || m_creature->m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->Id == SPELL_DEADEN) + if (m_creature->GetCurrentSpell(CURRENT_GENERIC_SPELL)->m_spellInfo->Id == SPELL_SOUL_SHOCK + || m_creature->GetCurrentSpell(CURRENT_GENERIC_SPELL)->m_spellInfo->Id == SPELL_DEADEN) m_creature->InterruptSpell(CURRENT_GENERIC_SPELL, false); } diff --git a/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp index e43afc2926f..02a88b214db 100644 --- a/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp +++ b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp @@ -686,7 +686,7 @@ struct TRINITY_DLL_DECL mob_greyheart_spellbinderAI : public ScriptedAI void CastChanneling() { - if (!m_creature->isInCombat() && !m_creature->m_currentSpells[CURRENT_CHANNELED_SPELL]) + if (!m_creature->isInCombat() && !m_creature->GetCurrentSpell(CURRENT_CHANNELED_SPELL)) { if (leotherasGUID) { @@ -745,7 +745,7 @@ struct TRINITY_DLL_DECL mob_greyheart_spellbinderAI : public ScriptedAI { bool isCasting = false; for(uint8 i = 0; i < CURRENT_MAX_SPELL; ++i) - if (i_pl->m_currentSpells[i]) + if (i_pl->GetCurrentSpell(i)) isCasting = true; if (isCasting) -- cgit v1.2.3