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

This commit is contained in:
HelloKitty
2018-09-15 11:00:20 -05:00
committed by Shauren
parent 0726812c34
commit 0d1eed5dab

View File

@@ -3392,6 +3392,8 @@ bool _isPositiveEffectImpl(SpellInfo const* spellInfo, uint8 effIndex, std::unor
visited.insert({ spellInfo->Id, effIndex });
//We need scaling level info for some auras that compute bp 0 or positive but should be debuffs
float bpScalePerLevel = spellInfo->Effects[effIndex].RealPointsPerLevel;
int32 bp = spellInfo->Effects[effIndex].CalcValue();
switch (spellInfo->SpellFamilyName)
{
@@ -3627,7 +3629,7 @@ bool _isPositiveEffectImpl(SpellInfo const* spellInfo, uint8 effIndex, std::unor
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