Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions prboom2/src/dsda/death.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,20 @@ typedef enum {
death_use_reload,
} death_use_action_t;

int dsda_SkipDeathUseAction(void)
{
// if demo playback, don't skip
if (demoplayback)
return false;

// if demo recording and death_use_nothing is set, skip DeathUseAction
if (demorecording)
if (players[consoleplayer].playerstate == PST_DEAD && dsda_IntConfig(dsda_config_death_use_action) == death_use_nothing)
return true;

return false;
}

static int dsda_DeathUseAction(void)
{
if (demorecording ||
Expand All @@ -50,6 +64,9 @@ static int dsda_DeathUseAction(void)
}

void dsda_DeathUse(player_t* player) {
if (dsda_SkipDeathUseAction())
return;

switch (dsda_DeathUseAction())
{
case death_use_default:
Expand Down
5 changes: 3 additions & 2 deletions prboom2/src/dsda/death.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
// DSDA Death
//

#ifndef __DSDA_DEMO__
#define __DSDA_DEMO__
#ifndef __DSDA_DEATH__
#define __DSDA_DEATH__

extern int dsda_SkipDeathUseAction(void);
void dsda_DeathUse(player_t* player);

#endif
10 changes: 7 additions & 3 deletions prboom2/src/g_game.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
#include "dsda/build.h"
#include "dsda/configuration.h"
#include "dsda/console.h"
#include "dsda/death.h"
#include "dsda/demo.h"
#include "dsda/excmd.h"
#include "dsda/exdemo.h"
Expand Down Expand Up @@ -837,7 +838,8 @@ void G_BuildTiccmd(ticcmd_t* cmd)

if (dsda_InputActive(dsda_input_use) || dsda_InputTickActivated(dsda_input_use))
{
cmd->buttons |= BT_USE;
if (!dsda_SkipDeathUseAction())
cmd->buttons |= BT_USE;
// clear double clicks if hit use button
dclicks = 0;
}
Expand Down Expand Up @@ -980,7 +982,8 @@ void G_BuildTiccmd(ticcmd_t* cmd)
dclicks++;
if (dclicks == 2)
{
cmd->buttons |= BT_USE;
if (!dsda_SkipDeathUseAction())
cmd->buttons |= BT_USE;
dclicks = 0;
}
else
Expand All @@ -1002,7 +1005,8 @@ void G_BuildTiccmd(ticcmd_t* cmd)
dclicks2++;
if (dclicks2 == 2)
{
cmd->buttons |= BT_USE;
if (!dsda_SkipDeathUseAction())
cmd->buttons |= BT_USE;
dclicks2 = 0;
}
else
Expand Down
Loading