aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjoschiwald <joschiwald.trinity@gmail.com>2016-10-23 14:45:31 +0200
committerjoschiwald <joschiwald.trinity@gmail.com>2016-10-23 14:45:31 +0200
commitcdb3b259168002868e17b2eff9da2e3804f3975b (patch)
treec7bfa790d5788b26aad1be308939419b28cb20bb /src
parent4ae38c0db2f58ddfa685d5a288e334a18293c2ae (diff)
Core/Spells: Fixed SpellEffects selection depending on Difficulty
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/SpellInfo.cpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp
index 3707aedf45f..45756a36ba1 100644
--- a/src/server/game/Spells/SpellInfo.cpp
+++ b/src/server/game/Spells/SpellInfo.cpp
@@ -3346,13 +3346,7 @@ SpellEffectInfoVector SpellInfo::GetEffectsForDifficulty(uint32 difficulty) cons
{
SpellEffectInfoVector effList;
- // DIFFICULTY_NONE effects are the default effects, always active if current difficulty's effects don't overwrite
- SpellEffectInfoMap::const_iterator itr = _effects.find(DIFFICULTY_NONE);
- if (itr != _effects.end())
- effList = itr->second;
-
// downscale difficulty if original was not found
- // DIFFICULTY_NONE is already in our list
DifficultyEntry const* difficultyEntry = sDifficultyStore.LookupEntry(difficulty);
while (difficultyEntry)
{
@@ -3361,7 +3355,6 @@ SpellEffectInfoVector SpellInfo::GetEffectsForDifficulty(uint32 difficulty) cons
{
for (SpellEffectInfo const* effect : effectItr->second)
{
- // overwrite any existing effect from DIFFICULTY_NONE
if (effect)
{
if (effect->EffectIndex >= effList.size())
@@ -3376,6 +3369,23 @@ SpellEffectInfoVector SpellInfo::GetEffectsForDifficulty(uint32 difficulty) cons
difficultyEntry = sDifficultyStore.LookupEntry(difficultyEntry->FallbackDifficultyID);
}
+ // DIFFICULTY_NONE effects are the default effects, always active if current difficulty's effects don't overwrite
+ SpellEffectInfoMap::const_iterator itr = _effects.find(DIFFICULTY_NONE);
+ if (itr != _effects.end())
+ {
+ for (SpellEffectInfo const* effect : itr->second)
+ {
+ if (effect)
+ {
+ if (effect->EffectIndex >= effList.size())
+ effList.resize(effect->EffectIndex + 1);
+
+ if (!effList[effect->EffectIndex])
+ effList[effect->EffectIndex] = effect;
+ }
+ }
+ }
+
return effList;
}