mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-27 22:42:57 +00:00
Fixed my error where I was using a local session variable rather than the proper user info for the weapon bob speed.
This commit is contained in:
parent
780d672b25
commit
bc0624e3b2
2 changed files with 4 additions and 6 deletions
|
@ -337,7 +337,7 @@ struct userinfo_t : TMap<FName,FBaseCVar *>
|
|||
{
|
||||
return *static_cast<FFloatCVar *>(*CheckKey(NAME_StillBob));
|
||||
}
|
||||
double GetWBobSpeed() const
|
||||
float GetWBobSpeed() const
|
||||
{
|
||||
return *static_cast<FFloatCVar *>(*CheckKey(NAME_WBobSpeed));
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue