[7848] Fix set variable to zero on apply -100% mod Author: SeT

--HG--
branch : trunk
This commit is contained in:
megamage
2009-05-18 15:15:22 -05:00
parent c3499f39da
commit df866dd37b

View File

@@ -92,7 +92,7 @@ inline void ApplyModFloatVar(float& var, float val, bool apply)
inline void ApplyPercentModFloatVar(float& var, float val, bool apply)
{
if (!apply && val == -100.0f)
if (val == -100.0f) // prevent set var to zero
val = -99.99f;
var *= (apply?(100.0f+val)/100.0f : 100.0f / (100.0f+val));
}