Переглянути джерело

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)

Azaezel 10 роки тому
батько
коміт
2da94ed4ee
1 змінених файлів з 2 додано та 1 видалено
  1. 2 1
      Templates/Full/game/scripts/server/radiusDamage.cs

+ 2 - 1
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,
       // Full damage is applied to anything less than half the radius away,
       // linear scale from there.
       // linear scale from there.
       %distScale = (%dist < %halfRadius)? 1.0 : 1.0 - ((%dist - %halfRadius) / %halfRadius);
       %distScale = (%dist < %halfRadius)? 1.0 : 1.0 - ((%dist - %halfRadius) / %halfRadius);
-
+      %distScale = mClamp(%distScale,0.0,1.0);
+      
       // Apply the damage
       // Apply the damage
       %targetObject.damage(%sourceObject, %position, %damage * %coverage * %distScale, %damageType);
       %targetObject.damage(%sourceObject, %position, %damage * %coverage * %distScale, %damageType);