Shared/Utils: Fixed ApplyPercentModFloatVar.

This has been around since 2010-12-11 :)
This commit is contained in:
Warpten
2013-07-10 21:44:08 +02:00
parent 50e59114b1
commit 2005be0474

View File

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