mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 00:48:56 +01:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user