Next/Prev weapon deactivate requires prior activate (#2175)

Fixes #2174
This commit is contained in:
Fabian Greffrath 2025-02-01 13:25:22 +01:00 committed by GitHub
parent e896ac183b
commit e0ebe4237c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;
@ -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)
@ -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;