From 21b690a3c77377e18a3e004d4e556701f93a4ac1 Mon Sep 17 00:00:00 2001 From: nashmuhandes Date: Thu, 20 Oct 2016 17:52:32 +0800 Subject: [PATCH] Fixed: Player.ViewBob should be multiplying the bobbing height in P_CalcHeight, not the velocity of the bobbing. This mimics the act of the user altering their movebob CVar to compensate for non-standard player movement speeds. --- src/p_user.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/p_user.cpp b/src/p_user.cpp index 845cf9a5f4..e487120429 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -1845,12 +1845,11 @@ void P_CalcHeight (player_t *player) return; } - //[SP] Added (x*player->mo->ViewBob) to allow DECORATE changes to view bobbing speed. if (still) { if (player->health > 0) { - angle = level.time / (120 * TICRATE / 35.) * 360. * player->mo->ViewBob; + angle = level.time / (120 * TICRATE / 35.) * 360.; bob = player->userinfo.GetStillBob() * angle.Sin(); } else @@ -1860,7 +1859,7 @@ void P_CalcHeight (player_t *player) } else { - angle = level.time / (20 * TICRATE / 35.) * 360. * player->mo->ViewBob; + angle = level.time / (20 * TICRATE / 35.) * 360.; bob = player->bob * angle.Sin() * (player->mo->waterlevel > 1 ? 0.25f : 0.5f); } @@ -1893,7 +1892,7 @@ void P_CalcHeight (player_t *player) { bob = 0; } - player->viewz = player->mo->Z() + player->viewheight + bob; + player->viewz = player->mo->Z() + player->viewheight + (bob * player->mo->ViewBob); // [SP] Allow DECORATE changes to view bobbing speed. if (player->mo->Floorclip && player->playerstate != PST_DEAD && player->mo->Z() <= player->mo->floorz) {