From bdaa101a28a5855e52fefd62019ade63e70b9e80 Mon Sep 17 00:00:00 2001 From: Trazom62 Date: Sun, 25 Apr 2010 15:52:15 +0200 Subject: 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 --- src/game/Unit.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'src') 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; } -- cgit v1.2.3