diff --git a/source/games/blood/src/player.cpp b/source/games/blood/src/player.cpp index a2c2ac810..6e6ebde77 100644 --- a/source/games/blood/src/player.cpp +++ b/source/games/blood/src/player.cpp @@ -1825,8 +1825,8 @@ void playerProcess(PLAYER* pPlayer) else pPlayer->zWeaponVel += dz * FixedToFloat(0xc00); pPlayer->zWeapon += pPlayer->zWeaponVel; - pPlayer->bobPhase = ClipLow(pPlayer->bobPhase - 4, 0); - int nSpeed = int(actor->vel.XY().Length()); + pPlayer->bobPhase = max(pPlayer->bobPhase - 4, 0.); + double nSpeed = actor->vel.XY().Length(); if (pPlayer->posture == 1) { pPlayer->bobAmp = (pPlayer->bobAmp + 17) & 2047; @@ -1846,12 +1846,12 @@ void playerProcess(PLAYER* pPlayer) if (running) { if (pPlayer->bobPhase < 60) - pPlayer->bobPhase = ClipHigh(pPlayer->bobPhase + nSpeed, 60); + pPlayer->bobPhase = min(pPlayer->bobPhase + nSpeed, 60.); } else { if (pPlayer->bobPhase < 30) - pPlayer->bobPhase = ClipHigh(pPlayer->bobPhase + nSpeed, 30); + pPlayer->bobPhase = min(pPlayer->bobPhase + nSpeed, 30.); } } pPlayer->bobHeight = pPosture->bobV * pPlayer->bobPhase * BobVal(pPlayer->bobAmp * 2); diff --git a/source/games/blood/src/player.h b/source/games/blood/src/player.h index bd970737b..b22551715 100644 --- a/source/games/blood/src/player.h +++ b/source/games/blood/src/player.h @@ -92,7 +92,7 @@ struct PLAYER bool isRunning; int posture; // stand, crouch, swim int sceneQav; // by NoOne: used to keep qav id - int bobPhase; + double bobPhase; int bobAmp; double bobHeight; double bobWidth; diff --git a/wadsrc/static/zscript/games/blood/bloodgame.zs b/wadsrc/static/zscript/games/blood/bloodgame.zs index ab4e7630a..9d34c3bbf 100644 --- a/wadsrc/static/zscript/games/blood/bloodgame.zs +++ b/wadsrc/static/zscript/games/blood/bloodgame.zs @@ -62,7 +62,7 @@ struct BloodPlayer native native bool isRunning; native int posture; // stand, crouch, swim native int sceneQav; // by NoOne: used to keep qav id - native int bobPhase; + native double bobPhase; native int bobAmp; native double bobHeight; native double bobWidth;