mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-18 15:32:33 +00:00
Merge branch 'coop-item-respawn' into 'master'
Allow item respawn in co-op again See merge request STJr/SRB2Internal!466
This commit is contained in:
commit
b0786f12de
4 changed files with 12 additions and 5 deletions
|
@ -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
|
||||
|
|
|
@ -2404,7 +2404,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 && gametype != GT_COOP && (modifiedgame || netgame || multiplayer))
|
||||
target->fuse = cv_itemrespawntime.value*TICRATE + 2; // Random box generation
|
||||
}
|
||||
|
||||
|
|
|
@ -11011,7 +11011,7 @@ 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
|
||||
|| (maptol & TOL_NIGHTS) // Never respawn in NiGHTs
|
||||
|| !cv_itemrespawn.value) // cvar is turned off
|
||||
return;
|
||||
|
||||
|
|
|
@ -2223,7 +2223,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;
|
||||
|
|
Loading…
Reference in a new issue