Core/Spells: Include RealPointsPerLevel when determining if aura is negative (#22427)

(cherry picked from commit 0d1eed5dab)
This commit is contained in:
HelloKitty
2018-09-15 11:00:20 -05:00
committed by Shauren
parent c5f5d53e98
commit c10ea61491

View File

@@ -4342,6 +4342,8 @@ bool _isPositiveEffectImpl(SpellInfo const* spellInfo, SpellEffectInfo const& ef
visited.insert({ spellInfo, effect.EffectIndex });
//We need scaling level info for some auras that compute bp 0 or positive but should be debuffs
float bpScalePerLevel = effect.RealPointsPerLevel;
int32 bp = effect.CalcValue();
switch (spellInfo->SpellFamilyName)
{
@@ -4549,7 +4551,7 @@ bool _isPositiveEffectImpl(SpellInfo const* spellInfo, SpellEffectInfo const& ef
case SPELL_AURA_MOD_INCREASE_HEALTH_PERCENT:
case SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE:
case SPELL_AURA_MOD_INCREASE_SWIM_SPEED:
if (bp < 0)
if (bp < 0 || bpScalePerLevel < 0) //TODO: What if both are 0? Should it be a buff or debuff?
return false;
break;
case SPELL_AURA_MOD_ATTACKSPEED: // some buffs have negative bp, check both target and bp