diff --git a/src/g_game.c b/src/g_game.c index 6e43aeb8b..600c8c896 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2592,6 +2592,8 @@ void G_DoReborn(INT32 playernum) { for (i = 0; i < MAXPLAYERS; i++) { + if (!playeringame[i]) + continue; players[i].starpostangle = 0; players[i].starposttime = 0; players[i].starpostx = 0; @@ -2602,9 +2604,15 @@ void G_DoReborn(INT32 playernum) } if (!countdowntimeup && (mapheaderinfo[gamemap-1]->levelflags & LF_NORELOAD)) { - player->playerstate = PST_REBORN; P_LoadThingsOnly(); - P_ClearStarPost(player->starpostnum); + + for (i = 0; i < MAXPLAYERS; i++) + { + if (!playeringame[i]) + continue; + players[i].playerstate = PST_REBORN; + P_ClearStarPost(players[i].starpostnum); + } // Do a wipe wipegamestate = -1; @@ -2628,12 +2636,24 @@ void G_DoReborn(INT32 playernum) CON_ClearHUD(); // Starpost support - G_SpawnPlayer(playernum, (player->starposttime)); + for (i = 0; i < MAXPLAYERS; i++) + { + if (!playeringame[i]) + continue; + G_SpawnPlayer(i, (players[i].starposttime)); + } - if (botingame) - { // Bots respawn next to their master. - players[secondarydisplayplayer].playerstate = PST_REBORN; - G_SpawnPlayer(secondarydisplayplayer, false); + // restore time in netgame (see also p_setup.c) + if ((netgame || multiplayer) && gametype == GT_COOP && cv_coopstarposts.value == 2) + { + // is this a hack? maybe + tic_t maxstarposttime = 0; + for (i = 0; i < MAXPLAYERS; i++) + { + if (playeringame[i] && players[i].starposttime > maxstarposttime) + maxstarposttime = players[i].starposttime; + } + leveltime = maxstarposttime; } } else diff --git a/src/p_setup.c b/src/p_setup.c index d40f4fc3b..8a91de76b 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2860,6 +2860,7 @@ boolean P_SetupLevel(boolean skipprecip) } } + // restore time in netgame (see also g_game.c) if ((netgame || multiplayer) && gametype == GT_COOP && cv_coopstarposts.value == 2) { // is this a hack? maybe