diff options
author | archshift <admin@archshift.com> | 2014-07-19 10:40:29 +0200 |
---|---|---|
committer | archshift <admin@archshift.com> | 2014-07-19 10:40:29 +0200 |
commit | 041bfd5860cd8ef51db42eb6fb4b50b45549feba (patch) | |
tree | 2d93a68b888a5e2b410ec95d124edaad6f67bb92 /src/Entities/SplashPotionEntity.cpp | |
parent | Renamed AllToLua_lua script. (diff) | |
download | cuberite-041bfd5860cd8ef51db42eb6fb4b50b45549feba.tar cuberite-041bfd5860cd8ef51db42eb6fb4b50b45549feba.tar.gz cuberite-041bfd5860cd8ef51db42eb6fb4b50b45549feba.tar.bz2 cuberite-041bfd5860cd8ef51db42eb6fb4b50b45549feba.tar.lz cuberite-041bfd5860cd8ef51db42eb6fb4b50b45549feba.tar.xz cuberite-041bfd5860cd8ef51db42eb6fb4b50b45549feba.tar.zst cuberite-041bfd5860cd8ef51db42eb6fb4b50b45549feba.zip |
Diffstat (limited to 'src/Entities/SplashPotionEntity.cpp')
-rw-r--r-- | src/Entities/SplashPotionEntity.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
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; |