From ffd9cfebe696a22f2dde9859e6f53023de043dc9 Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Thu, 14 Nov 2019 16:37:09 +0100 Subject: [PATCH 1/4] Allow item respawn in co-op again Why was it even disabled anyway. --- src/d_netcmd.c | 8 ++++++-- src/p_inter.c | 2 +- src/p_mobj.c | 1 - 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 3fb204aea..6a78d29bb 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -3907,13 +3907,17 @@ void D_GameTypeChanged(INT32 lastgametype) // There will always be a server, and this only needs to be done once. if (server && (multiplayer || netgame)) { - if (gametype == GT_COMPETITION || gametype == GT_COOP) + if (gametype == GT_COMPETITION) CV_SetValue(&cv_itemrespawn, 0); - else if (!cv_itemrespawn.changed) + else if (!cv_itemrespawn.changed || lastgametype == GT_COMPETITION) CV_SetValue(&cv_itemrespawn, 1); switch (gametype) { + case GT_COOP: + if (!cv_itemrespawntime.changed) + CV_Set(&cv_itemrespawntime, cv_itemrespawntime.defaultvalue); // respawn normally + break; case GT_MATCH: case GT_TEAMMATCH: if (!cv_timelimit.changed && !cv_pointlimit.changed) // user hasn't changed limits diff --git a/src/p_inter.c b/src/p_inter.c index c65e6cc36..d6f7da48a 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2392,7 +2392,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget { P_SetTarget(&target->target, source); source->player->numboxes++; - if ((cv_itemrespawn.value && gametype != GT_COOP && (modifiedgame || netgame || multiplayer))) + if (cv_itemrespawn.value && (modifiedgame || netgame || multiplayer)) target->fuse = cv_itemrespawntime.value*TICRATE + 2; // Random box generation } diff --git a/src/p_mobj.c b/src/p_mobj.c index 498cf897e..32b261fb8 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -11011,7 +11011,6 @@ void P_RespawnSpecials(void) // only respawn items when cv_itemrespawn is on if (!(netgame || multiplayer) // Never respawn in single player - || gametype == GT_COOP // Never respawn in co-op gametype || !cv_itemrespawn.value) // cvar is turned off return; From cccf1c8a7b92dae879062a13e37a0e3ff46a51f3 Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Thu, 14 Nov 2019 19:25:19 +0100 Subject: [PATCH 2/4] Disable perfect bonus in multiplayer --- src/p_setup.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/p_setup.c b/src/p_setup.c index aff6c33d7..f414a87eb 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2221,7 +2221,10 @@ static void P_LevelInitStuff(void) tokenbits = 0; runemeraldmanager = false; emeraldspawndelay = 60*TICRATE; - nummaprings = mapheaderinfo[gamemap-1]->startrings; + if ((netgame || multiplayer) && !G_IsSpecialStage(gamemap)) + nummaprings = -1; + else + nummaprings = mapheaderinfo[gamemap-1]->startrings; // emerald hunt hunt1 = hunt2 = hunt3 = NULL; From 18dc6013eda54b5eb86e497fbc53e71a66408cba Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Thu, 14 Nov 2019 21:21:42 +0100 Subject: [PATCH 3/4] Disable item respawn in NiGHTs levels --- src/p_mobj.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/p_mobj.c b/src/p_mobj.c index 32b261fb8..6fe336f88 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -11011,6 +11011,7 @@ void P_RespawnSpecials(void) // only respawn items when cv_itemrespawn is on if (!(netgame || multiplayer) // Never respawn in single player + || (maptol & TOL_NIGHTS) // Never respawn in NiGHTs || !cv_itemrespawn.value) // cvar is turned off return; From f4beb4a56fd3aae435d84a73f6ec65607ccb209d Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Thu, 14 Nov 2019 22:27:02 +0100 Subject: [PATCH 4/4] Disable monitor respawning in co-op --- src/p_inter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_inter.c b/src/p_inter.c index d6f7da48a..102341777 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2392,7 +2392,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget { P_SetTarget(&target->target, source); source->player->numboxes++; - if (cv_itemrespawn.value && (modifiedgame || netgame || multiplayer)) + if (cv_itemrespawn.value && gametype != GT_COOP && (modifiedgame || netgame || multiplayer)) target->fuse = cv_itemrespawntime.value*TICRATE + 2; // Random box generation }