diff options
author | Rat <gmstreetrat@gmail.com> | 2014-11-24 18:57:49 +0100 |
---|---|---|
committer | Rat <gmstreetrat@gmail.com> | 2014-11-24 18:57:49 +0100 |
commit | 2144d6c85159ad1e8529ef8e8ee1476e947fca92 (patch) | |
tree | 75f88bd9e73e4e860d4d2e6608e078341844ae7d /src/server/game/Spells/SpellScript.cpp | |
parent | 42fa46a11d7ee09054fa3e759307e2a7318b4d71 (diff) |
Core/Spells: core now builds without scripts project, still not stable
Diffstat (limited to 'src/server/game/Spells/SpellScript.cpp')
-rw-r--r-- | src/server/game/Spells/SpellScript.cpp | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp index 8ab3a72b47e..00a9fa5eb45 100644 --- a/src/server/game/Spells/SpellScript.cpp +++ b/src/server/game/Spells/SpellScript.cpp @@ -110,11 +110,14 @@ std::string _SpellScript::EffectHook::EffIndexToString() bool _SpellScript::EffectNameCheck::Check(SpellInfo const* spellEntry, uint8 effIndex) { - if (!spellEntry->Effects[effIndex].Effect && !effName) + SpellEffectInfo const* effect = spellEntry->GetEffect(effIndex); + if (!effect) + return false; + if (!effect->Effect && !effName) return true; - if (!spellEntry->Effects[effIndex].Effect) + if (!effect->Effect) return false; - return (effName == SPELL_EFFECT_ANY) || (spellEntry->Effects[effIndex].Effect == effName); + return (effName == SPELL_EFFECT_ANY) || (effect->Effect == effName); } std::string _SpellScript::EffectNameCheck::ToString() @@ -132,11 +135,14 @@ std::string _SpellScript::EffectNameCheck::ToString() bool _SpellScript::EffectAuraNameCheck::Check(SpellInfo const* spellEntry, uint8 effIndex) { - if (!spellEntry->Effects[effIndex].ApplyAuraName && !effAurName) + SpellEffectInfo const* effect = spellEntry->GetEffect(effIndex); + if (!effect) + return false; + if (!effect->ApplyAuraName && !effAurName) return true; - if (!spellEntry->Effects[effIndex].ApplyAuraName) + if (!effect->ApplyAuraName) return false; - return (effAurName == SPELL_AURA_ANY) || (spellEntry->Effects[effIndex].ApplyAuraName == effAurName); + return (effAurName == SPELL_AURA_ANY) || (effect->ApplyAuraName == effAurName); } std::string _SpellScript::EffectAuraNameCheck::ToString() @@ -218,8 +224,12 @@ bool SpellScript::TargetHook::CheckEffect(SpellInfo const* spellEntry, uint8 eff if (!targetType) return false; - if (spellEntry->Effects[effIndex].TargetA.GetTarget() != targetType && - spellEntry->Effects[effIndex].TargetB.GetTarget() != targetType) + SpellEffectInfo const* effect = spellEntry->GetEffect(effIndex); + if (!effect) + return false; + + if (effect->TargetA.GetTarget() != targetType && + effect->TargetB.GetTarget() != targetType) return false; SpellImplicitTargetInfo targetInfo(targetType); |