From 55338ff53bdc73e5bab02c00ef25b0a2ce354096 Mon Sep 17 00:00:00 2001 From: Warpten Date: Thu, 11 Jul 2013 11:10:05 +0200 Subject: Revert "Shared/Utils: Fixed ApplyPercentModFloatVar." This reverts commit 2005be04740406f17bd8af8569f2cd75aa0614d4. Note to self: do not touch maths past 10 any more. --- src/server/shared/Utilities/Util.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/server/shared/Utilities') diff --git a/src/server/shared/Utilities/Util.h b/src/server/shared/Utilities/Util.h index fff86b11901..a379bfd32fc 100644 --- a/src/server/shared/Utilities/Util.h +++ b/src/server/shared/Utilities/Util.h @@ -114,8 +114,7 @@ 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 - val) / 100.0f; + var *= (apply ? (100.0f + val) / 100.0f : 100.0f / (100.0f + val)); } // Percentage calculation -- cgit v1.2.3