Core/Spell: Fix name clashing between local variables and class member fields (#25352)

This commit is contained in:
Giacomo Pozzoni
2020-08-29 14:33:49 +02:00
committed by GitHub
parent 7e6f17a701
commit 8a48ece573
4 changed files with 60 additions and 23 deletions

View File

@@ -579,7 +579,7 @@ m_caster((info->HasAttribute(SPELL_ATTR6_CAST_BY_CHARMER) && caster->GetCharmerO
unitTarget = nullptr;
itemTarget = nullptr;
gameObjTarget = nullptr;
corpseTarget = nullptr;
m_corpseTarget = nullptr;
destTarget = nullptr;
damage = 0;
targetMissInfo = SPELL_MISS_NONE;
@@ -593,7 +593,6 @@ m_caster((info->HasAttribute(SPELL_ATTR6_CAST_BY_CHARMER) && caster->GetCharmerO
m_cast_count = 0;
m_glyphIndex = 0;
m_triggeredByAuraSpell = nullptr;
unitCaster = nullptr;
_spellAura = nullptr;
_dynObjAura = nullptr;
@@ -5074,9 +5073,8 @@ void Spell::HandleEffects(Unit* pUnitTarget, Item* pItemTarget, GameObject* pGoT
unitTarget = pUnitTarget;
itemTarget = pItemTarget;
gameObjTarget = pGoTarget;
corpseTarget = pCorpseTarget;
m_corpseTarget = pCorpseTarget;
destTarget = &m_destTargets[i]._position;
unitCaster = m_originalCaster ? m_originalCaster : m_caster->ToUnit();
uint8 effect = m_spellInfo->Effects[i].Effect;
ASSERT(effect < TOTAL_SPELL_EFFECTS); // checked at startup
@@ -7433,6 +7431,11 @@ bool Spell::IsNeedSendToClient() const
m_spellInfo->Speed > 0.0f || (!m_triggeredByAuraSpell && !IsTriggered());
}
Unit* Spell::GetUnitCasterForEffectHandlers() const
{
return m_originalCaster ? m_originalCaster : m_caster->ToUnit();
}
SpellEvent::SpellEvent(Spell* spell) : BasicEvent()
{
m_Spell = spell;