From bc1adc9c51d40c4a4eafae592be2b509bae526aa Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 4 Dec 2020 00:06:23 +0100 Subject: [PATCH] - Blood: fixed cl_autorun affecting bobbing intensity even when no movement takes place. Blood uses the state of the 'run' bit as the sole information that the player is running, which leads to very different behavior with cl_autorun on or off. Apparently Raze's semantics here do not agree with how it was handled originally and the residual bobbing when coming to a stop was more than a little bit distracting. --- source/blood/src/player.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/blood/src/player.cpp b/source/blood/src/player.cpp index 3a2ce754b..d345a9b71 100644 --- a/source/blood/src/player.cpp +++ b/source/blood/src/player.cpp @@ -1707,9 +1707,10 @@ void playerProcess(PLAYER *pPlayer) { if (pXSprite->height < 256) { - pPlayer->bobAmp = (pPlayer->bobAmp+pPosture->pace[pPlayer->isRunning]*4) & 2047; - pPlayer->swayAmp = (pPlayer->swayAmp+(pPosture->pace[pPlayer->isRunning]*4)/2) & 2047; - if (pPlayer->isRunning) + bool running = pPlayer->isRunning && pPlayer->restTime <= 10; + pPlayer->bobAmp = (pPlayer->bobAmp+pPosture->pace[running]*4) & 2047; + pPlayer->swayAmp = (pPlayer->swayAmp+(pPosture->pace[running]*4)/2) & 2047; + if (running) { if (pPlayer->bobPhase < 60) pPlayer->bobPhase = ClipHigh(pPlayer->bobPhase+nSpeed, 60);