diff --git a/src/d_main.cpp b/src/d_main.cpp index c5b77942e7..c5e83cf58c 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -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); //========================================================================== // diff --git a/src/doomdef.h b/src/doomdef.h index 70759a406d..98fa88d939 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -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. diff --git a/src/g_level.cpp b/src/g_level.cpp index 386df8d093..4fcef5f753 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -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; } diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index ed0d727c5f..7c8359cd5e 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -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"