From 2da94ed4eee706d9ec96c4b74eb577bcf191e1a9 Mon Sep 17 00:00:00 2001 From: Azaezel Date: Fri, 9 Oct 2015 17:43:00 -0500 Subject: [PATCH] explosion cover miscalc %distscale can actually end up negative. causes miscalculations for applyimpulse and the like (or even healing if you've hacked in the capacity for negative damage) --- Templates/Full/game/scripts/server/radiusDamage.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Templates/Full/game/scripts/server/radiusDamage.cs b/Templates/Full/game/scripts/server/radiusDamage.cs index 808d3b7d6..db2573459 100644 --- a/Templates/Full/game/scripts/server/radiusDamage.cs +++ b/Templates/Full/game/scripts/server/radiusDamage.cs @@ -56,7 +56,8 @@ function radiusDamage(%sourceObject, %position, %radius, %damage, %damageType, % // Full damage is applied to anything less than half the radius away, // linear scale from there. %distScale = (%dist < %halfRadius)? 1.0 : 1.0 - ((%dist - %halfRadius) / %halfRadius); - + %distScale = mClamp(%distScale,0.0,1.0); + // Apply the damage %targetObject.damage(%sourceObject, %position, %damage * %coverage * %distScale, %damageType);