mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-22 03:12:00 -04:00
Clear weapon slot only once per tic
In case an input is pressed and released before the next G_BuildTiccmd call.
This commit is contained in:
parent
7b260243e0
commit
ddb24e3316
@ -903,7 +903,7 @@ void G_BuildTiccmd(ticcmd_t* cmd)
|
||||
|
||||
// [FG] prev/next weapon keys and buttons
|
||||
next_weapon = 0;
|
||||
WS_ClearSharedEvent();
|
||||
WS_UpdateStateTic();
|
||||
|
||||
// [FG] double click acts as "use"
|
||||
if (dclick)
|
||||
|
@ -331,14 +331,16 @@ boolean WS_HoldOverride(void)
|
||||
}
|
||||
|
||||
//
|
||||
// WS_ClearSharedEvent
|
||||
// WS_UpdateStateTic
|
||||
//
|
||||
void WS_ClearSharedEvent(void)
|
||||
void WS_UpdateStateTic(void)
|
||||
{
|
||||
if (shared_event.restored)
|
||||
{
|
||||
ResetSharedEvent();
|
||||
}
|
||||
|
||||
state.current_slot = NULL;
|
||||
}
|
||||
|
||||
static void RestoreSharedEvent(void)
|
||||
@ -425,7 +427,6 @@ static boolean UpdateSelection(const event_t *ev)
|
||||
{
|
||||
state.selected = false;
|
||||
state.input_key = -1;
|
||||
state.current_slot = NULL;
|
||||
}
|
||||
break;
|
||||
|
||||
@ -723,7 +724,6 @@ weapontype_t WS_SlotWeapon(void)
|
||||
const weapontype_t current_weapon = CurrentWeapon(player);
|
||||
const weapontype_t *slot_weapons = state.current_slot->weapons;
|
||||
const int num_weapons = state.current_slot->num_weapons;
|
||||
state.current_slot = NULL;
|
||||
|
||||
if (!demo_compatibility)
|
||||
{
|
||||
|
@ -45,7 +45,7 @@ void WS_UpdateState(const struct event_s *ev);
|
||||
boolean WS_Override(void);
|
||||
boolean WS_HoldOverride(void);
|
||||
|
||||
void WS_ClearSharedEvent(void);
|
||||
void WS_UpdateStateTic(void);
|
||||
boolean WS_Responder(const struct event_s *ev);
|
||||
|
||||
boolean WS_SlotSelected(void);
|
||||
|
Loading…
x
Reference in New Issue
Block a user