Skip to content

Commit

Permalink
Next/Prev weapon deactivate requires prior activate (#2175)
Browse files Browse the repository at this point in the history
Fixes #2174
  • Loading branch information
fabiangreffrath authored Feb 1, 2025
1 parent e896ac1 commit e0ebe42
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/g_nextweapon.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ typedef enum
{
nw_state_none,
nw_state_activate,
nw_state_currently_active,
nw_state_deactivate,
nw_state_cmd
} next_weapon_state_t;
Expand All @@ -159,7 +160,10 @@ void G_NextWeaponUpdate(void)
else if (M_InputDeactivated(input_prevweapon)
|| M_InputDeactivated(input_nextweapon))
{
state = nw_state_deactivate;
if (state == nw_state_currently_active)
{
state = nw_state_deactivate;
}
}

if (weapon != wp_nochange)
Expand All @@ -173,7 +177,7 @@ boolean G_NextWeaponActivate(void)
{
if (state == nw_state_activate)
{
state = nw_state_none;
state = nw_state_currently_active;
return true;
}
return false;
Expand Down

0 comments on commit e0ebe42

Please sign in to comment.