From 2005be04740406f17bd8af8569f2cd75aa0614d4 Mon Sep 17 00:00:00 2001 From: Warpten Date: Wed, 10 Jul 2013 21:44:08 +0200 Subject: Shared/Utils: Fixed ApplyPercentModFloatVar. This has been around since 2010-12-11 :) --- src/server/shared/Utilities/Util.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/server') diff --git a/src/server/shared/Utilities/Util.h b/src/server/shared/Utilities/Util.h index a379bfd32fc..fff86b11901 100644 --- a/src/server/shared/Utilities/Util.h +++ b/src/server/shared/Utilities/Util.h @@ -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 -- cgit v1.2.3