From bc0624e3b2c8c8993a120e1d17d82dd117742fce Mon Sep 17 00:00:00 2001 From: raa-eruanna Date: Fri, 16 Sep 2016 03:48:09 -0400 Subject: [PATCH] Fixed my error where I was using a local session variable rather than the proper user info for the weapon bob speed. --- src/d_player.h | 2 +- src/p_pspr.cpp | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index 6f68aa6f7..5206fd770 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -337,7 +337,7 @@ struct userinfo_t : TMap { return *static_cast(*CheckKey(NAME_StillBob)); } - double GetWBobSpeed() const + float GetWBobSpeed() const { return *static_cast(*CheckKey(NAME_WBobSpeed)); } diff --git a/src/p_pspr.cpp b/src/p_pspr.cpp index 4274d81a8..099a39f02 100644 --- a/src/p_pspr.cpp +++ b/src/p_pspr.cpp @@ -528,9 +528,6 @@ void P_DropWeapon (player_t *player) // //============================================================================ -// [SP] Changes how quickly the weapon bobs -EXTERN_CVAR(Float, wbobspeed) - void P_BobWeapon (player_t *player, float *x, float *y, double ticfrac) { static float curbob; @@ -555,8 +552,9 @@ void P_BobWeapon (player_t *player, float *x, float *y, double ticfrac) for (int i = 0; i < 2; i++) { - // Bob the weapon based on movement speed. - FAngle angle = (BobSpeed * wbobspeed * 35 / TICRATE*(level.time - 1 + i)) * (360.f / 8192.f); + // Bob the weapon based on movement speed. ([SP] And user's bob speed setting) + FAngle angle = (BobSpeed * player->userinfo.GetWBobSpeed() * 35 / + TICRATE*(level.time - 1 + i)) * (360.f / 8192.f); // [RH] Smooth transitions between bobbing and not-bobbing frames. // This also fixes the bug where you can "stick" a weapon off-center by