Skip to content

Commit

Permalink
Add weapon bob only option per #13
Browse files Browse the repository at this point in the history
  • Loading branch information
JadingTsunami committed Apr 25, 2024
1 parent 87cb8ff commit 20eceae
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ Example: `set overunder 1`
* `r_drawplayersprites` (default: on) - Same meaning as the same-named [GZDoom CVAR](https://zdoom.org/wiki/CVARs:Display#r_drawplayersprites)
* `overunder` (default: off) - Allow things to move over/under other things (adapted from [Crispy Doom](https://github.com/fabiangreffrath/crispy-doom) and [Nugget Doom](https://github.com/MrAlaux/Nugget-Doom))
* `announce_100p_max` (default: off) - Announce when 100% kills, items, and secrets has been achieved.
* `weapon_bob_only` (default: off) - Only bob player's weapon, not the player's view.

# Reference Material

Expand Down
1 change: 1 addition & 0 deletions prboom2/src/c_cvar.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ void C_CvarInit()
C_CvarCreate("r_drawplayersprites", "1", CVAR_FLAG_ARCHIVE);
C_CvarCreate("overunder", "0", CVAR_FLAG_ARCHIVE);
C_CvarCreate("announce_100p_max", "0", CVAR_FLAG_ARCHIVE);
C_CvarCreate("weapon_bob_only", "0", CVAR_FLAG_ARCHIVE);
}
}

Expand Down
3 changes: 2 additions & 1 deletion prboom2/src/p_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include "r_fps.h"
#include "g_game.h"
#include "e6y.h"//e6y
#include "c_cvar.h"

//
// Movement.
Expand Down Expand Up @@ -169,7 +170,7 @@ void P_CalcHeight (player_t* player)
player->bob = MAXBOB;
}

if (!onground || player->cheats & CF_NOMOMENTUM)
if (!onground || player->cheats & CF_NOMOMENTUM || C_CvarIsSet("weapon_bob_only"))
{
player->viewz = player->mo->z + VIEWHEIGHT;

Expand Down

0 comments on commit 20eceae

Please sign in to comment.