From 041bfd5860cd8ef51db42eb6fb4b50b45549feba Mon Sep 17 00:00:00 2001 From: archshift Date: Sat, 19 Jul 2014 01:40:29 -0700 Subject: Fixed clamping issues --- src/Entities/SplashPotionEntity.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/Entities/SplashPotionEntity.cpp') diff --git a/src/Entities/SplashPotionEntity.cpp b/src/Entities/SplashPotionEntity.cpp index 3efb1f25d..ccadf9c8e 100644 --- a/src/Entities/SplashPotionEntity.cpp +++ b/src/Entities/SplashPotionEntity.cpp @@ -44,10 +44,7 @@ public: // y = -0.25x + 1, where x is the distance from the player. Approximation for potion splash. // TODO: better equation double Reduction = -0.25 * SplashDistance + 1.0; - if (Reduction < 0) - { - Reduction = 0; - } + Reduction = std::max(Reduction, 0.0); ((cPawn *) a_Entity)->AddEntityEffect(m_EntityEffectType, m_EntityEffect.GetDuration(), m_EntityEffect.GetIntensity(), Reduction); return false; -- cgit v1.2.3