From 8a4e1119ac21e2d1112d1717337597fe073e495f Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 4 Sep 2021 15:13:15 +0200 Subject: Core/Spells: Unify spell effect access api in both branches --- src/server/scripts/Commands/cs_lookup.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp index 8ea4aa3dc27..2481abbdffc 100644 --- a/src/server/scripts/Commands/cs_lookup.cpp +++ b/src/server/scripts/Commands/cs_lookup.cpp @@ -886,10 +886,10 @@ public: bool known = target && target->HasSpell(spellInfo->Id); - SpellEffectInfo const* effect = spellInfo->GetEffect(EFFECT_0); - bool learn = effect ? (effect->Effect == SPELL_EFFECT_LEARN_SPELL) : false; + SpellEffectInfo const& spellEffectInfo = spellInfo->GetEffect(EFFECT_0); + bool learn = spellEffectInfo.IsEffect(SPELL_EFFECT_LEARN_SPELL); - SpellInfo const* learnSpellInfo = effect ? sSpellMgr->GetSpellInfo(effect->TriggerSpell, spellInfo->Difficulty) : nullptr; + SpellInfo const* learnSpellInfo = sSpellMgr->GetSpellInfo(spellEffectInfo.TriggerSpell, spellInfo->Difficulty); bool talent = spellInfo->HasAttribute(SPELL_ATTR0_CU_IS_TALENT); bool passive = spellInfo->IsPassive(); @@ -959,10 +959,10 @@ public: bool known = target && target->HasSpell(id); - SpellEffectInfo const* effect = spellInfo->GetEffect(EFFECT_0); - bool learn = effect? (effect->Effect == SPELL_EFFECT_LEARN_SPELL) : false; + SpellEffectInfo const& spellEffectInfo = spellInfo->GetEffect(EFFECT_0); + bool learn = spellEffectInfo.IsEffect(SPELL_EFFECT_LEARN_SPELL); - SpellInfo const* learnSpellInfo = effect ? sSpellMgr->GetSpellInfo(effect->TriggerSpell, DIFFICULTY_NONE) : nullptr; + SpellInfo const* learnSpellInfo = sSpellMgr->GetSpellInfo(spellEffectInfo.TriggerSpell, DIFFICULTY_NONE); bool talent = spellInfo->HasAttribute(SPELL_ATTR0_CU_IS_TALENT); bool passive = spellInfo->IsPassive(); -- cgit v1.2.3