Allow item respawn in co-op again

Why was it even disabled anyway.
This commit is contained in:
Louis-Antoine 2019-11-14 16:37:09 +01:00
parent 1f7e5aa150
commit ffd9cfebe6
3 changed files with 7 additions and 4 deletions

View file

@ -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

View file

@ -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
}

View file

@ -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;