diff --git a/src/d_main.cpp b/src/d_main.cpp index 515592f95..62f58d5b3 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -508,6 +508,7 @@ CVAR (Flag, sv_disallowsuicide, dmflags2, DF2_NOSUICIDE); CVAR (Flag, sv_noautoaim, dmflags2, DF2_NOAUTOAIM); CVAR (Flag, sv_dontcheckammo, dmflags2, DF2_DONTCHECKAMMO); CVAR (Flag, sv_killbossmonst, dmflags2, DF2_KILLBOSSMONST); +CVAR (Flag, sv_nocountendmonst, dmflags2, DF2_NOCOUNTENDMONST); //========================================================================== // // CVAR compatflags diff --git a/src/doomdef.h b/src/doomdef.h index b0ad82f89..03de866ef 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -296,6 +296,7 @@ enum DF2_NOAUTOAIM = 1 << 23, // Players cannot use autoaim. DF2_DONTCHECKAMMO = 1 << 24, // Don't Check ammo when switching weapons. DF2_KILLBOSSMONST = 1 << 25, // Kills all monsters spawned by a boss cube when the boss dies + DF2_NOCOUNTENDMONST = 1 << 26, // Do not count monsters in 'end level when dying' sectors towards kill count }; // [RH] Compatibility flags. diff --git a/src/p_setup.cpp b/src/p_setup.cpp index 4a4f66474..3ddd2e259 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -3928,6 +3928,24 @@ void P_SetupLevel (char *lumpname, int position) } } + // Don't count monsters in end-of-level sectors if option is on + if (dmflags2 & DF2_NOCOUNTENDMONST) + { + TThinkerIterator it; + AActor * mo; + + while ((mo=it.Next())) + { + if (mo->flags & MF_COUNTKILL) + { + if (mo->Sector->special == dDamage_End) + { + mo->ClearCounters(); + } + } + } + } + T_PreprocessScripts(); // preprocess FraggleScript scripts // build subsector connect matrix diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index 679d85a28..f7e0b51b2 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -1107,6 +1107,7 @@ OptionMenu GameplayOptions Option "Chasecam cheat", "sv_chasecam", "YesNo" Option "Check ammo for weapon switch", "sv_dontcheckammo", "NoYes" Option "Killing Romero kills all his spawns", "sv_killbossmonst", "YesNo" + Option "Count monsters in end level sectors", "sv_nocountendmonst", "NoYes" StaticText " " StaticText "Deathmatch Settings",1