- Reintroduced damage thrust clamping but with a higher threshold. The clamping

is now also done in floating point before any fixed point overflows can occur.


SVN r1670 (trunk)
This commit is contained in:
Christoph Oelckers 2009-06-16 22:04:26 +00:00
parent d8bb215e70
commit db0a924fc9
6 changed files with 13 additions and 13 deletions

View file

@ -1,4 +1,8 @@
June 14, 2009 (Changes by Graf Zahl) June 16, 2009 (Changes by Graf Zahl)
- Reintroduced damage thrust clamping but with a higher threshold. The clamping
is now also done in floating point before any fixed point overflows can occur.
June 14, 2009 (Changes by Graf Zahl)
- added a compatibility option to restore the original Heretic bug where - added a compatibility option to restore the original Heretic bug where
a Minotaur couldn't spawn floor flames when standing in water having its a Minotaur couldn't spawn floor flames when standing in water having its
feet clipped. feet clipped.

View file

@ -442,7 +442,7 @@ void cht_DoCheat (player_t *player, int cheat)
// a very very cheap kill. // a very very cheap kill.
P_LineAttack (player->mo, player->mo->angle, PLAYERMISSILERANGE, P_LineAttack (player->mo, player->mo->angle, PLAYERMISSILERANGE,
P_AimLineAttack (player->mo, player->mo->angle, PLAYERMISSILERANGE), 1000000, P_AimLineAttack (player->mo, player->mo->angle, PLAYERMISSILERANGE), 1000000,
NAME_None, NAME_BulletPuff); NAME_MDK, NAME_BulletPuff);
} }
break; break;

View file

@ -235,6 +235,7 @@ xx(PoisonCloud) // makes monsters howl.
// Special death name for getting killed excessively. Could be used as // Special death name for getting killed excessively. Could be used as
// a damage type if you wanted to force an extreme death. // a damage type if you wanted to force an extreme death.
xx(Extreme) xx(Extreme)
xx(MDK)
// Special names for thingdef_exp.cpp // Special names for thingdef_exp.cpp
xx(Random) xx(Random)

View file

@ -1043,16 +1043,10 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
// Calculate this as float to avoid overflows so that the // Calculate this as float to avoid overflows so that the
// clamping that had to be done here can be removed. // clamping that had to be done here can be removed.
thrust = FLOAT2FIXED((damage * 0.125 * kickback) / target->Mass); double fltthrust = clamp((damage * 0.125 * kickback) / target->Mass, 0.,mod == NAME_MDK? 10. : 32.);
thrust = FLOAT2FIXED(fltthrust);
// [RH] If thrust overflows, use a more reasonable amount
/* old fixed point code that could overflow.
thrust = damage*(FRACUNIT>>3)*kickback / target->Mass;
if (thrust < 0 || thrust > 10*FRACUNIT)
{
thrust = 10*FRACUNIT;
}
*/
// make fall forwards sometimes // make fall forwards sometimes
if ((damage < 40) && (damage > target->health) if ((damage < 40) && (damage > target->health)
&& (target->z - origin->z > 64*FRACUNIT) && (target->z - origin->z > 64*FRACUNIT)

View file

@ -4520,6 +4520,7 @@ bool P_HitWater (AActor * thing, sector_t * sec, fixed_t x, fixed_t y, fixed_t z
AActor *mo = NULL; AActor *mo = NULL;
FSplashDef *splash; FSplashDef *splash;
int terrainnum; int terrainnum;
sector_t *hsec = NULL;
if (x == FIXED_MIN) x = thing->x; if (x == FIXED_MIN) x = thing->x;
if (y == FIXED_MIN) y = thing->y; if (y == FIXED_MIN) y = thing->y;
@ -4545,7 +4546,7 @@ bool P_HitWater (AActor * thing, sector_t * sec, fixed_t x, fixed_t y, fixed_t z
if (planez < z) return false; if (planez < z) return false;
} }
#endif #endif
sector_t *hsec = sec->GetHeightSec(); hsec = sec->GetHeightSec();
if (hsec == NULL || !(hsec->MoreFlags & SECF_CLIPFAKEPLANES)) if (hsec == NULL || !(hsec->MoreFlags & SECF_CLIPFAKEPLANES))
{ {
terrainnum = TerrainTypes[sec->GetTexture(sector_t::floor)]; terrainnum = TerrainTypes[sec->GetTexture(sector_t::floor)];

View file

@ -217,7 +217,7 @@ int FWadCollection::AddExternalFile(const char *filename)
FWadCollection::LumpRecord *lumprec = &LumpInfo[LumpInfo.Reserve(1)]; FWadCollection::LumpRecord *lumprec = &LumpInfo[LumpInfo.Reserve(1)];
lumprec->lump = lump; lumprec->lump = lump;
lumprec->wadnum = -1; lumprec->wadnum = -1;
return 0; // later return LumpInfo.Size()-1; // later
} }
//========================================================================== //==========================================================================