Core/Spells: Removed useless calls of Spell::GetEffect and SpellInfo::GetEffect

This commit is contained in:
joschiwald
2018-08-11 15:08:57 +02:00
parent 3cc42d7692
commit 652f9302b7
3 changed files with 18 additions and 20 deletions

View File

@@ -1291,9 +1291,9 @@ class spell_gen_despawn_self : public SpellScriptLoader
return GetCaster()->GetTypeId() == TYPEID_UNIT;
}
void HandleDummy(SpellEffIndex effIndex)
void HandleDummy(SpellEffIndex /*effIndex*/)
{
if (GetSpellInfo()->GetEffect(effIndex)->Effect == SPELL_EFFECT_DUMMY || GetSpellInfo()->GetEffect(effIndex)->Effect == SPELL_EFFECT_SCRIPT_EFFECT)
if (GetEffectInfo()->IsEffect(SPELL_EFFECT_DUMMY) || GetEffectInfo()->IsEffect(SPELL_EFFECT_SCRIPT_EFFECT))
GetCaster()->ToCreature()->DespawnOrUnsummon();
}
@@ -2457,8 +2457,8 @@ class spell_gen_oracle_wolvar_reputation : public SpellScriptLoader
void HandleDummy(SpellEffIndex effIndex)
{
Player* player = GetCaster()->ToPlayer();
uint32 factionId = GetSpellInfo()->GetEffect(effIndex)->CalcValue();
int32 repChange = GetSpellInfo()->GetEffect(EFFECT_1)->CalcValue();
uint32 factionId = GetEffectInfo(effIndex)->CalcValue();
int32 repChange = GetEffectInfo(EFFECT_1)->CalcValue();
FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionId);
if (!factionEntry)

View File

@@ -1315,7 +1315,7 @@ class spell_brewfest_relay_race_intro_force_player_to_throw : public SpellScript
PreventHitDefaultEffect(effIndex);
// All this spells trigger a spell that requires reagents; if the
// triggered spell is cast as "triggered", reagents are not consumed
GetHitUnit()->CastSpell((Unit*)NULL, GetSpellInfo()->GetEffect(effIndex)->TriggerSpell, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_POWER_AND_REAGENT_COST));
GetHitUnit()->CastSpell(nullptr, GetEffectInfo()->TriggerSpell, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_POWER_AND_REAGENT_COST));
}
void Register() override