1
0

Fixed clamping issues

This commit is contained in:
archshift
2014-07-19 01:40:29 -07:00
parent c7b7938c04
commit 041bfd5860
6 changed files with 6 additions and 33 deletions

View File

@@ -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;