Skip to content

Commit

Permalink
Added pistol start gameplay option
Browse files Browse the repository at this point in the history
Automatically resets the player's inventory and health when changing maps.
  • Loading branch information
Boondorl authored and madame-rachelle committed Apr 21, 2024
1 parent f156abc commit 132a150
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/d_main.cpp
Expand Up @@ -580,6 +580,7 @@ CVAR(Flag, sv_nolocaldrops, dmflags3, DF3_NO_LOCAL_DROPS);
CVAR(Flag, sv_nocoopitems, dmflags3, DF3_NO_COOP_ONLY_ITEMS);
CVAR(Flag, sv_nocoopthings, dmflags3, DF3_NO_COOP_ONLY_THINGS);
CVAR(Flag, sv_rememberlastweapon, dmflags3, DF3_REMEMBER_LAST_WEAP);
CVAR(Flag, sv_pistolstart, dmflags3, DF3_PISTOL_START);

//==========================================================================
//
Expand Down
1 change: 1 addition & 0 deletions src/doomdef.h
Expand Up @@ -186,6 +186,7 @@ enum : unsigned
DF3_NO_COOP_ONLY_ITEMS = 1 << 4, // Items that only appear in co-op are disabled
DF3_NO_COOP_ONLY_THINGS = 1 << 5, // Any Actor that only appears in co-op is disabled
DF3_REMEMBER_LAST_WEAP = 1 << 6, // When respawning in co-op, keep the last used weapon out instead of switching to the best new one.
DF3_PISTOL_START = 1 << 7, // Take player inventory when exiting to the next level.
};

// [RH] Compatibility flags.
Expand Down
5 changes: 3 additions & 2 deletions src/g_level.cpp
Expand Up @@ -776,11 +776,12 @@ void FLevelLocals::ChangeLevel(const char *levelname, int position, int inflags,
{
if (thiscluster != nextcluster || (thiscluster && !(thiscluster->flags & CLUSTER_HUB)))
{
if (nextinfo->flags2 & LEVEL2_RESETINVENTORY)
const bool doReset = dmflags3 & DF3_PISTOL_START;
if (doReset || (nextinfo->flags2 & LEVEL2_RESETINVENTORY))
{
inflags |= CHANGELEVEL_RESETINVENTORY;
}
if (nextinfo->flags2 & LEVEL2_RESETHEALTH)
if (doReset || (nextinfo->flags2 & LEVEL2_RESETHEALTH))
{
inflags |= CHANGELEVEL_RESETHEALTH;
}
Expand Down
1 change: 1 addition & 0 deletions wadsrc/static/menudef.txt
Expand Up @@ -1630,6 +1630,7 @@ OptionMenu GameplayOptions protected
StaticText " "
Option "$GMPLYMNU_SMARTAUTOAIM", "sv_smartaim", "SmartAim"
StaticText " "
Option "$GMPLYMNU_PISTOLSTART", "sv_pistolstart", "YesNo"
Option "$GMPLYMNU_FALLINGDAMAGE", "sv_fallingdamage", "FallingDM"
Option "$GMPLYMNU_DROPWEAPON", "sv_weapondrop", "YesNo"
Option "$GMPLYMNU_DOUBLEAMMO", "sv_doubleammo", "YesNo"
Expand Down

0 comments on commit 132a150

Please sign in to comment.