From 7ce364bf0ff6514944b688cf01036a92db8b27ac Mon Sep 17 00:00:00 2001 From: nashmuhandes Date: Fri, 16 Sep 2022 08:34:46 +0800 Subject: [PATCH] Add sv_noextraammo. When set to true, disables that weird hardcoded behavior from original Doom that gives extra ammo when picking up weapons in deathmatch --- src/d_main.cpp | 1 + src/doomdef.h | 1 + wadsrc/static/menudef.txt | 1 + wadsrc/static/zscript/actors/inventory/weapons.zs | 2 +- 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/d_main.cpp b/src/d_main.cpp index 255280570..59695e07a 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -565,6 +565,7 @@ CVAR (Flag, sv_respawnsuper, dmflags2, DF2_RESPAWN_SUPER); CVAR (Flag, sv_nothingspawn, dmflags2, DF2_NO_COOP_THING_SPAWN); CVAR (Flag, sv_alwaysspawnmulti, dmflags2, DF2_ALWAYS_SPAWN_MULTI); CVAR (Flag, sv_novertspread, dmflags2, DF2_NOVERTSPREAD); +CVAR (Flag, sv_noextraammo, dmflags2, DF2_NO_EXTRA_AMMO); //========================================================================== // diff --git a/src/doomdef.h b/src/doomdef.h index d84830b86..835a15c6c 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -173,6 +173,7 @@ enum DF2_NO_COOP_THING_SPAWN = 1 << 28, // Don't spawn multiplayer things in coop games DF2_ALWAYS_SPAWN_MULTI = 1 << 29, // Always spawn multiplayer items DF2_NOVERTSPREAD = 1 << 30, // Don't allow vertical spread for hitscan weapons (excluding ssg) + DF2_NO_EXTRA_AMMO = 1 << 31, // Don't add extra ammo when picking up weapons (like in original Doom) }; // [RH] Compatibility flags. diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index 337ffe8e8..252b086cc 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -1683,6 +1683,7 @@ OptionMenu DeathmatchOptions protected Option "$GMPLYMNU_LOSEFRAG", "sv_losefrag", "YesNo" Option "$GMPLYMNU_KEEPFRAGS", "sv_keepfrags", "YesNo" Option "$GMPLYMNU_NOTEAMSWITCH", "sv_noteamswitch", "YesNo" + Option "$GMPLYMNU_NOEXTRAAMMO", "sv_noextraammo", "NoYes" Class "GameplayMenu" } diff --git a/wadsrc/static/zscript/actors/inventory/weapons.zs b/wadsrc/static/zscript/actors/inventory/weapons.zs index e3284f913..288ae8f8f 100644 --- a/wadsrc/static/zscript/actors/inventory/weapons.zs +++ b/wadsrc/static/zscript/actors/inventory/weapons.zs @@ -742,7 +742,7 @@ class Weapon : StateProvider // [BC] This behavior is from the original Doom. Give 5/2 times as much ammoitem when // we pick up a weapon in deathmatch. - if (( deathmatch ) && ( gameinfo.gametype & GAME_DoomChex )) + if (( deathmatch && !sv_noextraammo ) && ( gameinfo.gametype & GAME_DoomChex )) amount = amount * 5 / 2; // extra ammoitem in baby mode and nightmare mode