Skip to content

Commit f4a42da

Browse files
Boondorlmadame-rachelle
authored andcommitted
Added pistol start gameplay option
Automatically resets the player's inventory and health when changing maps.
1 parent d63d720 commit f4a42da

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

src/d_main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,7 @@ CVAR(Flag, sv_nolocaldrops, dmflags3, DF3_NO_LOCAL_DROPS);
580580
CVAR(Flag, sv_nocoopitems, dmflags3, DF3_NO_COOP_ONLY_ITEMS);
581581
CVAR(Flag, sv_nocoopthings, dmflags3, DF3_NO_COOP_ONLY_THINGS);
582582
CVAR(Flag, sv_rememberlastweapon, dmflags3, DF3_REMEMBER_LAST_WEAP);
583+
CVAR(Flag, sv_pistolstart, dmflags3, DF3_PISTOL_START);
583584

584585
//==========================================================================
585586
//

src/doomdef.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ enum : unsigned
186186
DF3_NO_COOP_ONLY_ITEMS = 1 << 4, // Items that only appear in co-op are disabled
187187
DF3_NO_COOP_ONLY_THINGS = 1 << 5, // Any Actor that only appears in co-op is disabled
188188
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.
189+
DF3_PISTOL_START = 1 << 7, // Take player inventory when exiting to the next level.
189190
};
190191

191192
// [RH] Compatibility flags.

src/g_level.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -776,11 +776,12 @@ void FLevelLocals::ChangeLevel(const char *levelname, int position, int inflags,
776776
{
777777
if (thiscluster != nextcluster || (thiscluster && !(thiscluster->flags & CLUSTER_HUB)))
778778
{
779-
if (nextinfo->flags2 & LEVEL2_RESETINVENTORY)
779+
const bool doReset = dmflags3 & DF3_PISTOL_START;
780+
if (doReset || (nextinfo->flags2 & LEVEL2_RESETINVENTORY))
780781
{
781782
inflags |= CHANGELEVEL_RESETINVENTORY;
782783
}
783-
if (nextinfo->flags2 & LEVEL2_RESETHEALTH)
784+
if (doReset || (nextinfo->flags2 & LEVEL2_RESETHEALTH))
784785
{
785786
inflags |= CHANGELEVEL_RESETHEALTH;
786787
}

wadsrc/static/menudef.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1630,6 +1630,7 @@ OptionMenu GameplayOptions protected
16301630
StaticText " "
16311631
Option "$GMPLYMNU_SMARTAUTOAIM", "sv_smartaim", "SmartAim"
16321632
StaticText " "
1633+
Option "$GMPLYMNU_PISTOLSTART", "sv_pistolstart", "YesNo"
16331634
Option "$GMPLYMNU_FALLINGDAMAGE", "sv_fallingdamage", "FallingDM"
16341635
Option "$GMPLYMNU_DROPWEAPON", "sv_weapondrop", "YesNo"
16351636
Option "$GMPLYMNU_DOUBLEAMMO", "sv_doubleammo", "YesNo"

0 commit comments

Comments
 (0)