From b072431d3b6abb43f721028d2c15bb21110cbb2d Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 7 Mar 2009 09:16:32 +0000 Subject: [PATCH] - Adjusted some gravity related thresholds for the fix from Feb 28. Also removed some unnecessary floating point math from this code. SVN r1465 (trunk) --- docs/rh-log.txt | 6 +++++- src/p_mobj.cpp | 11 ++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 909e0bca00..dc0517fc8e 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,8 @@ -March 6, 2009 (Changes by Graf Zahl) +March 7, 2009 (Changes by Graf Zahl) +- Adjusted some gravity related thresholds for the fix from Feb 28. Also removed + some unnecessary floating point math from this code. + +March 6, 2009 (Changes by Graf Zahl) - Added Hirogen2's patch for unlimited ammo CVAR. March 4, 2009 diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 6d33313dfc..b6153387bd 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -1984,14 +1984,11 @@ void P_ZMovement (AActor *mo) mo->z = mo->floorz; if (mo->momz < 0) { - // [RH] avoid integer roundoff by doing comparisons with floats - // I can't think of any good reason why this varied with gravity - float minmom = 800.f /*level.gravity * mo->Sector->gravity*/ * -655.36f; - float mom = (float)mo->momz; + const fixed_t minmom = -9*FRACUNIT; // landing speed from a jump with normal gravity // Spawn splashes, etc. P_HitFloor (mo); - if (mo->DamageType == NAME_Ice && mom < minmom) + if (mo->DamageType == NAME_Ice && mo->momz < minmom) { mo->tics = 1; mo->momx = 0; @@ -2004,7 +2001,7 @@ void P_ZMovement (AActor *mo) if (mo->player) { mo->player->jumpTics = 7; // delay any jumping for a short while - if (mom < minmom && !(mo->flags & MF_NOGRAVITY)) + if (mo->momz < minmom && !(mo->flags & MF_NOGRAVITY)) { // Squat down. // Decrease viewheight for a moment after hitting the ground (hard), @@ -4402,7 +4399,7 @@ foundone: // Don't splash for living things with small vertical velocities. // There are levels where the constant splashing from the monsters gets extremely annoying - if ((thing->flags3&MF3_ISMONSTER || thing->player) && thing->momz>=-5*FRACUNIT) return Terrains[terrainnum].IsLiquid; + if ((thing->flags3&MF3_ISMONSTER || thing->player) && thing->momz>=-6*FRACUNIT) return Terrains[terrainnum].IsLiquid; splash = &Splashes[splashnum];