aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
authorTrazom62 <none@none>2010-04-25 15:52:15 +0200
committerTrazom62 <none@none>2010-04-25 15:52:15 +0200
commitbdaa101a28a5855e52fefd62019ade63e70b9e80 (patch)
tree0f57e62c5cf84400feac3bb22fca28b1251bba02 /src/game/Unit.cpp
parenteccf5bf547c9b1648a453695189877c212071c70 (diff)
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
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 3c9dc12a5ee..be231666d43 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -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;
}