diff --git a/src/doom/d_main.c b/src/doom/d_main.c index 1008fefaf1..fe7c1744a8 100644 --- a/src/doom/d_main.c +++ b/src/doom/d_main.c @@ -108,6 +108,7 @@ boolean nomonsters; // checkparm of -nomonsters boolean respawnparm; // checkparm of -respawn boolean fastparm; // checkparm of -fast boolean coop_spawns = false; // [crispy] checkparm of -coop_spawns +boolean coop2 = false; // [crispy] checkparm of -coop2 @@ -1577,6 +1578,21 @@ void D_DoomMain (void) if (M_CheckParm ("-dm3")) deathmatch = 3; + //! + // @arg + // @category net + // + // [crispy] Start a coop game. + // Spawn mp monsters. Don't spawn other mp things. + // + + p = M_ParmExists("-coop2"); + + if (p) + { + coop2 = true; + } + if (devparm) DEH_printf(D_DEVSTR); diff --git a/src/doom/d_net.c b/src/doom/d_net.c index 4da8004aa3..27c944ddd2 100644 --- a/src/doom/d_net.c +++ b/src/doom/d_net.c @@ -100,6 +100,37 @@ static loop_interface_t doom_loop_interface = { M_Ticker }; +// +// LoadDeathmatchGameSettings +// [crispy] Loads correct deatmatch setting from a net game +// +static void LoadDeathmatchGameSettings(int deathmatch_setings) +{ + if (deathmatch_setings == 4) + { + coop2 = true; + deathmatch = 0; + return; + } + + deathmatch = deathmatch_setings; +} + +// +// SaveDeathmatchGameSettings +// [crispy] Saves correct deatmatch setting for a net game +// from global variables +// +static void SaveDeathmatchGameSettings(net_gamesettings_t *settings) +{ + if (coop2) + { + settings->deathmatch = 4; + return; + } + + settings->deathmatch = deathmatch; +} // Load game settings from the specified structure and // set global variables. @@ -108,7 +139,7 @@ static void LoadGameSettings(net_gamesettings_t *settings) { unsigned int i; - deathmatch = settings->deathmatch; + LoadDeathmatchGameSettings(settings->deathmatch); // [crispy] startepisode = settings->episode; startmap = settings->map; startskill = settings->skill; @@ -140,7 +171,7 @@ static void SaveGameSettings(net_gamesettings_t *settings) // Fill in game settings structure with appropriate parameters // for the new game - settings->deathmatch = deathmatch; + SaveDeathmatchGameSettings(settings); // [crispy] settings->episode = startepisode; settings->map = startmap; settings->skill = startskill; diff --git a/src/doom/doomstat.h b/src/doom/doomstat.h index 262e6c4e59..ca91036f25 100644 --- a/src/doom/doomstat.h +++ b/src/doom/doomstat.h @@ -48,6 +48,7 @@ extern boolean nomonsters; // checkparm of -nomonsters extern boolean respawnparm; // checkparm of -respawn extern boolean fastparm; // checkparm of -fast extern boolean coop_spawns; // [crispy] checkparm of -coop_spawns +extern boolean coop2; // [crispy] checkparm of -coop2 extern boolean devparm; // DEBUG: launched with -devparm diff --git a/src/doom/p_mobj.c b/src/doom/p_mobj.c index e3348d3398..447b85d847 100644 --- a/src/doom/p_mobj.c +++ b/src/doom/p_mobj.c @@ -1057,6 +1057,12 @@ void P_SpawnMapThing (mapthing_t* mthing) return; } + // [crispy] Don't spawn any mp-only things except monsters in the netgame + if (netgame && coop2 && (mthing->options & 16) && !(i == MT_SKULL || (mobjinfo[i].flags & MF_COUNTKILL))) + { + return; + } + // spawn it x = mthing->x << FRACBITS; y = mthing->y << FRACBITS; diff --git a/src/net_common.c b/src/net_common.c index 6e764644eb..1f47918798 100644 --- a/src/net_common.c +++ b/src/net_common.c @@ -439,7 +439,7 @@ boolean NET_ValidGameSettings(GameMode_t mode, GameMission_t mission, if (settings->extratics < 0) return false; - if (settings->deathmatch < 0 || settings->deathmatch > 3) + if (settings->deathmatch < 0 || settings->deathmatch > 4) return false; if (settings->skill < sk_noitems || settings->skill > sk_nightmare) diff --git a/src/setup/multiplayer.c b/src/setup/multiplayer.c index 24517519db..795595c5ff 100644 --- a/src/setup/multiplayer.c +++ b/src/setup/multiplayer.c @@ -113,7 +113,7 @@ static const char *strife_skills[] = static const char *character_classes[] = { "Fighter", "Cleric", "Mage" }; -static const char *gamemodes[] = { "Co-operative", "Deathmatch", "Deathmatch 2.0", "Deathmatch 3.0" }; +static const char *gamemodes[] = { "Co-operative", "Deathmatch", "Deathmatch 2.0", "Deathmatch 3.0", "Coop 2" }; static const char *strife_gamemodes[] = { @@ -272,6 +272,10 @@ static void StartGame(int multiplayer) { AddCmdLineParameter(exec, "-dm3"); } + else if (deathmatch == 4) // [cripsy] Coop 2 + { + AddCmdLineParameter(exec, "-coop2"); + } if (timer > 0) {