diff options
author | Shauren <shauren.trinity@gmail.com> | 2014-12-14 11:28:13 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2014-12-14 11:28:13 +0100 |
commit | edf5fc223639a1f3400bc54a2de2e8fcdbf022d2 (patch) | |
tree | b509806093dde30ce5d2a0bc611e7f540b0159b1 /src | |
parent | 16ff14e758c2d3c5ee1cb9006c67382c251fb926 (diff) |
Core/Spells: Fixed a crash in SpellInfo::GetEffect happening when the current difficulty did not have an overriding effect
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Spells/SpellInfo.cpp | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 7c0e328ca3b..faebf1dcfa4 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -341,8 +341,6 @@ SpellImplicitTargetInfo::StaticData SpellImplicitTargetInfo::_data[TOTAL_SPELL_ SpellEffectInfo::SpellEffectInfo(SpellEntry const* /*spellEntry*/, SpellInfo const* spellInfo, uint8 effIndex, SpellEffectEntry const* _effect) { - SpellScalingEntry const* scaling = spellInfo->GetSpellScaling(); - _spellInfo = spellInfo; EffectIndex = _effect ? _effect->EffectIndex : effIndex; Effect = _effect ? _effect->Effect : 0; @@ -870,21 +868,12 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntryMap effects) _effects[itr->first][effect->EffectIndex] = new SpellEffectInfo(spellEntry, this, effect->EffectIndex, effect); } - - /*_effects[itr->first].resize(MAX_SPELL_EFFECTS); - for (SpellEffectEntryVector::const_iterator i = itr->second.begin(); i != itr->second.end(); ++i) - { - if (!(*i)) - continue; - - _effects[itr->first][(*i)->EffectIndex] = new SpellEffectInfo(spellEntry, this, (*i)->EffectIndex, (*i)); - }*/ } SpellName = spellEntry->Name_lang; - //Rank = spellEntry->Rank; + Rank = nullptr; RuneCostID = spellEntry->RuneCostID; - //SpellDifficultyId = spellEntry->DifficultyID; + SpellDifficultyId = 0; SpellScalingId = spellEntry->ScalingID; SpellAuraOptionsId = spellEntry->AuraOptionsID; SpellAuraRestrictionsId = spellEntry->AuraRestrictionsID; @@ -3097,8 +3086,9 @@ SpellEffectInfoVector SpellInfo::GetEffectsForDifficulty(uint32 difficulty) cons { for (SpellEffectInfo const* effect : itr->second) { - // overwrite any existing effect from DIFFICULTY_NONE - effList[effect->EffectIndex] = effect; + // overwrite any existing effect from DIFFICULTY_NONE + if (effect) + effList[effect->EffectIndex] = effect; } // if we found any effect in our difficulty then stop searching break; |