mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-06 22:10:36 +00:00
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)
This commit is contained in:
parent
2044b2691e
commit
2da94ed4ee
1 changed files with 2 additions and 1 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue