mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-23 03:52:12 -04:00
Fix death-use action on intermission screen (#1973)
* Clean up action/state variables * Fix "use" on intermission screen
This commit is contained in:
parent
3d8ec36807
commit
c94b994195
16
src/g_game.c
16
src/g_game.c
@ -687,19 +687,21 @@ static void AdjustWeaponSelection(int *newweapon)
|
||||
|
||||
static boolean FilterDeathUseAction(void)
|
||||
{
|
||||
if (players[consoleplayer].playerstate & PST_DEAD)
|
||||
if (players[consoleplayer].playerstate == PST_DEAD && gamestate == GS_LEVEL)
|
||||
{
|
||||
switch (death_use_action)
|
||||
{
|
||||
case death_use_nothing:
|
||||
case DEATH_USE_ACTION_NOTHING:
|
||||
return true;
|
||||
case death_use_reload:
|
||||
|
||||
case DEATH_USE_ACTION_LAST_SAVE:
|
||||
if (!demoplayback && !demorecording && !netgame
|
||||
&& activate_death_use_reload == 0)
|
||||
&& death_use_state == DEATH_USE_STATE_INACTIVE)
|
||||
{
|
||||
activate_death_use_reload = 2;
|
||||
death_use_state = DEATH_USE_STATE_PENDING;
|
||||
}
|
||||
return true;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -1104,7 +1106,7 @@ static void G_DoLoadLevel(void)
|
||||
// Set the initial listener parameters using the player's initial state.
|
||||
S_InitListener(players[displayplayer].mo);
|
||||
|
||||
activate_death_use_reload = 0;
|
||||
death_use_state = DEATH_USE_STATE_INACTIVE;
|
||||
|
||||
// clear cmd building stuff
|
||||
memset (gamekeydown, 0, sizeof(gamekeydown));
|
||||
@ -4847,7 +4849,7 @@ void G_BindGameVariables(void)
|
||||
32, UL, UL, ss_none, wad_no,
|
||||
"Maximum number of player corpses (< 0 = No limit)");
|
||||
BIND_NUM_GENERAL(death_use_action, 0, 0, 2,
|
||||
"Use-button action upon death (0 = Default; 1 = Load save; 2 = Nothing)");
|
||||
"Use-button action upon death (0 = Default; 1 = Last Save; 2 = Nothing)");
|
||||
BIND_BOOL_GENERAL(autosave, true,
|
||||
"Auto save at the beginning of a map, after completing the previous one");
|
||||
}
|
||||
|
@ -257,7 +257,7 @@ void P_MovePlayer (player_t* player)
|
||||
#define ANG5 (ANG90/18)
|
||||
|
||||
death_use_action_t death_use_action;
|
||||
int activate_death_use_reload;
|
||||
death_use_state_t death_use_state;
|
||||
|
||||
//
|
||||
// P_DeathThink
|
||||
@ -318,9 +318,9 @@ void P_DeathThink (player_t* player)
|
||||
player->playerstate = PST_REBORN;
|
||||
}
|
||||
|
||||
if (activate_death_use_reload == 2)
|
||||
if (death_use_state == DEATH_USE_STATE_PENDING)
|
||||
{
|
||||
activate_death_use_reload = 1;
|
||||
death_use_state = DEATH_USE_STATE_ACTIVE;
|
||||
|
||||
if (!G_AutoSaveEnabled() || !G_LoadAutoSaveDeathUse())
|
||||
{
|
||||
|
16
src/p_user.h
16
src/p_user.h
@ -35,13 +35,21 @@ void P_Thrust(struct player_s *player, angle_t angle, fixed_t move);
|
||||
|
||||
typedef enum
|
||||
{
|
||||
death_use_default,
|
||||
death_use_reload,
|
||||
death_use_nothing
|
||||
DEATH_USE_ACTION_DEFAULT,
|
||||
DEATH_USE_ACTION_LAST_SAVE,
|
||||
DEATH_USE_ACTION_NOTHING
|
||||
} death_use_action_t;
|
||||
|
||||
extern death_use_action_t death_use_action;
|
||||
extern int activate_death_use_reload;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
DEATH_USE_STATE_INACTIVE,
|
||||
DEATH_USE_STATE_PENDING,
|
||||
DEATH_USE_STATE_ACTIVE
|
||||
} death_use_state_t;
|
||||
|
||||
extern death_use_state_t death_use_state;
|
||||
|
||||
extern boolean onground; // whether player is on ground or in air
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user