From 2da94ed4eee706d9ec96c4b74eb577bcf191e1a9 Mon Sep 17 00:00:00 2001 From: Azaezel Date: Fri, 9 Oct 2015 17:43:00 -0500 Subject: [PATCH 1/2] 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); From 348a0f20d908aec7064e87a3b1bd67f69c7d8967 Mon Sep 17 00:00:00 2001 From: Azaezel Date: Sun, 18 Oct 2015 23:48:29 -0500 Subject: [PATCH 2/2] Looks like according to reports, they also weren't checking for physicsshapes. --- Templates/Full/game/scripts/server/radiusDamage.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Templates/Full/game/scripts/server/radiusDamage.cs b/Templates/Full/game/scripts/server/radiusDamage.cs index db2573459..91255f25c 100644 --- a/Templates/Full/game/scripts/server/radiusDamage.cs +++ b/Templates/Full/game/scripts/server/radiusDamage.cs @@ -29,7 +29,7 @@ function radiusDamage(%sourceObject, %position, %radius, %damage, %damageType, % // Use the container system to iterate through all the objects // within our explosion radius. We'll apply damage to all ShapeBase // objects. - InitContainerRadiusSearch(%position, %radius, $TypeMasks::ShapeBaseObjectType); + InitContainerRadiusSearch(%position, %radius, $TypeMasks::ShapeBaseObjectType | $TypeMasks::DynamicShapeObjectType); %halfRadius = %radius / 2; while ((%targetObject = containerSearchNext()) != 0)