- Fixed: If a damaged actor has negative mass, it needs to have its damage

thrust set to maximum instead of 0. See Action Doom's broken glass
  "CommanderKeens".


SVN r1816 (trunk)
This commit is contained in:
Randy Heit 2009-09-11 01:00:01 +00:00
commit 38780d2d2a
2 changed files with 10 additions and 1 deletions

View file

@ -1047,7 +1047,13 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
// Calculate this as float to avoid overflows so that the
// clamping that had to be done here can be removed.
double fltthrust = clamp((damage * 0.125 * kickback) / target->Mass, 0.,mod == NAME_MDK? 10. : 32.);
double fltthrust;
fltthrust = mod == NAME_MDK ? 10 : 32;
if (target->Mass > 0)
{
fltthrust = clamp((damage * 0.125 * kickback) / target->Mass, 0., fltthrust);
}
thrust = FLOAT2FIXED(fltthrust);