- Add the DF2_NO_COOP_THING_SPAWNDM flag to prevent spawning MP things in coop. (#1165)

This commit is contained in:
dondiego 2020-08-29 21:08:08 +02:00 committed by GitHub
parent 254489e34c
commit 560bbf0a9c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 1 deletions

View file

@ -661,6 +661,7 @@ CVAR (Flag, sv_dontcheckammo, dmflags2, DF2_DONTCHECKAMMO);
CVAR (Flag, sv_killbossmonst, dmflags2, DF2_KILLBOSSMONST);
CVAR (Flag, sv_nocountendmonst, dmflags2, DF2_NOCOUNTENDMONST);
CVAR (Flag, sv_respawnsuper, dmflags2, DF2_RESPAWN_SUPER);
CVAR (Flag, sv_nothingspawn, dmflags2, DF2_NO_COOP_THING_SPAWN);
//==========================================================================
//

View file

@ -141,7 +141,7 @@ enum
// [BC] More dmflags. w00p!
enum
{
// DF2_YES_IMPALING = 1 << 0, // Player gets implaed on MF2_IMPALE items
// DF2_YES_IMPALING = 1 << 0, // Player gets impaled on MF2_IMPALE items
DF2_YES_WEAPONDROP = 1 << 1, // Drop current weapon upon death
// DF2_NO_RUNES = 1 << 2, // Don't spawn runes
// DF2_INSTANT_RETURN = 1 << 3, // Instantly return flags and skulls when player carrying it dies (ST/CTF)
@ -169,6 +169,7 @@ enum
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
DF2_RESPAWN_SUPER = 1 << 27, // Respawn invulnerability and invisibility
DF2_NO_COOP_THING_SPAWN = 1 << 28, // Don't spawn multiplayer things in coop games
};
// [RH] Compatibility flags.

View file

@ -5571,6 +5571,13 @@ AActor *FLevelLocals::SpawnMapThing (FMapThing *mthing, int position)
if (deathmatch && info->flags & MF_NOTDMATCH)
return NULL;
// don't spawn extra things in coop if so desired
if (multiplayer && !deathmatch && (dmflags2 & DF2_NO_COOP_THING_SPAWN))
{
if ((mthing->flags & (MTF_DEATHMATCH|MTF_SINGLE)) == MTF_DEATHMATCH)
return NULL;
}
// [RH] don't spawn extra weapons in coop if so desired
if (multiplayer && !deathmatch && (dmflags & DF_NO_COOP_WEAPON_SPAWN))
{

View file

@ -1664,6 +1664,7 @@ OptionMenu CoopOptions protected
Position -35
Title "$GMPLYMNU_COOPERATIVE"
Option "$GMPLYMNU_MULTIPLAYERTHINGS", "sv_nothingspawn", "NoYes"
Option "$GMPLYMNU_MULTIPLAYERWEAPONS", "sv_noweaponspawn", "NoYes"
Option "$GMPLYMNU_LOSEINVENTORY", "sv_cooploseinventory", "YesNo"
Option "$GMPLYMNU_KEEPKEYS", "sv_cooplosekeys", "NoYes"