mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-22 03:12:00 -04:00
fix next/prev weapon without carousel (#2201)
* fix next/prev weapon without carousel Fixes #2196 * reset currently_active state to false in G_NextWeaponReset()
This commit is contained in:
parent
d14083f946
commit
b760605a51
@ -138,12 +138,12 @@ typedef enum
|
|||||||
{
|
{
|
||||||
nw_state_none,
|
nw_state_none,
|
||||||
nw_state_activate,
|
nw_state_activate,
|
||||||
nw_state_currently_active,
|
|
||||||
nw_state_deactivate,
|
nw_state_deactivate,
|
||||||
nw_state_cmd
|
nw_state_cmd
|
||||||
} next_weapon_state_t;
|
} next_weapon_state_t;
|
||||||
|
|
||||||
static next_weapon_state_t state;
|
static next_weapon_state_t state;
|
||||||
|
static boolean currently_active;
|
||||||
|
|
||||||
void G_NextWeaponUpdate(void)
|
void G_NextWeaponUpdate(void)
|
||||||
{
|
{
|
||||||
@ -160,14 +160,16 @@ void G_NextWeaponUpdate(void)
|
|||||||
else if (M_InputDeactivated(input_prevweapon)
|
else if (M_InputDeactivated(input_prevweapon)
|
||||||
|| M_InputDeactivated(input_nextweapon))
|
|| M_InputDeactivated(input_nextweapon))
|
||||||
{
|
{
|
||||||
if (state == nw_state_currently_active)
|
if (currently_active)
|
||||||
{
|
{
|
||||||
|
currently_active = false;
|
||||||
state = nw_state_deactivate;
|
state = nw_state_deactivate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (weapon != wp_nochange)
|
if (weapon != wp_nochange)
|
||||||
{
|
{
|
||||||
|
currently_active = true;
|
||||||
state = nw_state_activate;
|
state = nw_state_activate;
|
||||||
players[consoleplayer].nextweapon = weapon;
|
players[consoleplayer].nextweapon = weapon;
|
||||||
}
|
}
|
||||||
@ -177,7 +179,7 @@ boolean G_NextWeaponActivate(void)
|
|||||||
{
|
{
|
||||||
if (state == nw_state_activate)
|
if (state == nw_state_activate)
|
||||||
{
|
{
|
||||||
state = nw_state_currently_active;
|
state = nw_state_none;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -216,6 +218,7 @@ void G_NextWeaponResendCmd(void)
|
|||||||
|
|
||||||
void G_NextWeaponReset(void)
|
void G_NextWeaponReset(void)
|
||||||
{
|
{
|
||||||
|
currently_active = false;
|
||||||
state = nw_state_none;
|
state = nw_state_none;
|
||||||
ST_ResetCarousel();
|
ST_ResetCarousel();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user