Added pistol start gameplay option

Automatically resets the player's inventory and health when changing maps.
This commit is contained in:
Boondorl 2024-04-18 14:54:43 -04:00 committed by Rachael Alexanderson
parent d63d720d4c
commit f4a42dae1d
4 changed files with 6 additions and 2 deletions

View file

@ -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);
//==========================================================================
//

View file

@ -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.

View file

@ -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;
}

View file

@ -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"