Fix HandleStatModifier for BASE_PCT and TOTAL_PCT modifierType.

Formula was incorrect. It gave a slight advantage when there are several auras for the same UnitMod.
Ex: if you had 2 auras giving 50%,
- previous formula would give: 1*1.5*1.5=2.25
- new formula give: 1+0.5+0.5=2.00 which is correct.

Hack for negative pct <= -100 is also no longer necessary

--HG--
branch : trunk
This commit is contained in:
Trazom62
2010-04-25 15:52:15 +02:00
parent eccf5bf547
commit bdaa101a28

View File

@@ -12621,8 +12621,6 @@ bool Unit::HandleStatModifier(UnitMods unitMod, UnitModifierType modifierType, f
return false;
}
float val = 1.0f;
switch (modifierType)
{
case BASE_VALUE:
@@ -12631,14 +12629,7 @@ bool Unit::HandleStatModifier(UnitMods unitMod, UnitModifierType modifierType, f
break;
case BASE_PCT:
case TOTAL_PCT:
if (amount <= -100.0f) //small hack-fix for -100% modifiers
amount = -200.0f;
val = (100.0f + amount) / 100.0f;
m_auraModifiersGroup[unitMod][modifierType] *= apply ? val : (1.0f/val);
break;
default:
m_auraModifiersGroup[unitMod][modifierType] += (apply ? amount : -amount) / 100.0f;
break;
}