aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/SpellInfo.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2021-10-16 22:05:02 +0200
committerShauren <shauren.trinity@gmail.com>2021-10-16 22:05:02 +0200
commitba4fa060d765a35507f1a73287504c3f2e440fdb (patch)
treee166fc1f4de33ddb87243482d159077cda2879d8 /src/server/game/Spells/SpellInfo.cpp
parent3e81db7b9380269d4561eb5deb21fbef26913779 (diff)
Core/Auras: Implemented SPELL_AURA_ADD_PCT_MODIFIER_BY_SPELL_LABEL and SPELL_AURA_ADD_FLAT_MODIFIER_BY_SPELL_LABEL
Diffstat (limited to 'src/server/game/Spells/SpellInfo.cpp')
-rw-r--r--src/server/game/Spells/SpellInfo.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp
index 44896751acb..3ae31465448 100644
--- a/src/server/game/Spells/SpellInfo.cpp
+++ b/src/server/game/Spells/SpellInfo.cpp
@@ -1729,9 +1729,22 @@ bool SpellInfo::IsAffectedBySpellMod(SpellModifier const* mod) const
if (!affectSpell)
return false;
- // TEMP: dont use IsAffected - !familyName and !familyFlags are not valid options for spell mods
- // TODO: investigate if the !familyName and !familyFlags conditions are even valid for all other (nonmod) uses of SpellInfo::IsAffected
- return affectSpell->SpellFamilyName == SpellFamilyName && mod->mask & SpellFamilyFlags;
+ switch (mod->type)
+ {
+ case SPELLMOD_FLAT:
+ case SPELLMOD_PCT:
+ // TEMP: dont use IsAffected - !familyName and !familyFlags are not valid options for spell mods
+ // TODO: investigate if the !familyName and !familyFlags conditions are even valid for all other (nonmod) uses of SpellInfo::IsAffected
+ return affectSpell->SpellFamilyName == SpellFamilyName && static_cast<SpellModifierByClassMask const*>(mod)->mask & SpellFamilyFlags;
+ case SPELLMOD_LABEL_FLAT:
+ return HasLabel(static_cast<SpellFlatModifierByLabel const*>(mod)->value.LabelID);
+ case SPELLMOD_LABEL_PCT:
+ return HasLabel(static_cast<SpellPctModifierByLabel const*>(mod)->value.LabelID);
+ default:
+ break;
+ }
+
+ return false;
}
bool SpellInfo::CanPierceImmuneAura(SpellInfo const* auraSpellInfo) const