From a872f1c68f16a97acc62d87a876d3ec594c1638a Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 3 Jun 2017 22:14:20 +0100 Subject: [PATCH] I'm starting to actually test this via netgame instead of just in splitscreen! * Fixed oversight where late joiners may not actually get lives. * Fixed oversight where zero-livers could spawn in. * Reinstated flashing because a crawla walked onto one of the spawnpoints and we immediately got a game over. * Rejiggered the overlay drawer so the printing was consistent between normal spectatorship and game overness. --- src/g_game.c | 3 +++ src/p_mobj.c | 9 +++++---- src/st_stuff.c | 6 +++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 566d536c1..942ea4d64 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2754,6 +2754,9 @@ void G_AddPlayer(INT32 playernum) p->jointime = 0; p->playerstate = PST_REBORN; + if (G_GametypeUsesLives()) + p->lives = cv_startinglives.value; + if (countplayers && !notexiting) P_DoPlayerExit(p); } diff --git a/src/p_mobj.c b/src/p_mobj.c index aa76cddf1..f93bafe7e 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -9084,9 +9084,10 @@ void P_SpawnPlayer(INT32 playernum) // spawn as spectator determination if (!G_GametypeHasSpectators()) { - if ( ( (multiplayer || netgame) && gametype == GT_COOP && leveltime > 0) // only question status in coop - && ( (G_IsSpecialStage(gamemap) && useNightsSS) // late join special stage - || (cv_coopstarposts.value == 2 && (p->jointime < 1 || p->spectator) ) // late join or die in new coop + if (((multiplayer || netgame) && gametype == GT_COOP) // only question status in coop + && ((leveltime > 0 + && ((G_IsSpecialStage(gamemap) && useNightsSS) // late join special stage + || (cv_coopstarposts.value == 2 && (p->jointime < 1 || p->spectator)))) // late join or die in new coop || ((!cv_cooplives.value || !P_GetLives(p)) && p->lives <= 0))) // game over and can't redistribute lives p->spectator = true; else @@ -9135,7 +9136,7 @@ void P_SpawnPlayer(INT32 playernum) p->skincolor = skincolor_blueteam; } - if ((netgame || multiplayer) && !p->spectator && (gametype != GT_COOP || ((p->jointime < 1) && !(G_IsSpecialStage(gamemap) && useNightsSS)))) + if ((netgame || multiplayer) && !p->spectator) p->powers[pw_flashing] = flashingtics-1; // Babysitting deterrent mobj = P_SpawnMobj(0, 0, 0, MT_PLAYER); diff --git a/src/st_stuff.c b/src/st_stuff.c index b2ef0bf28..fb099c7c4 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -1983,7 +1983,7 @@ static void ST_overlayDrawer(void) if (!hu_showscores && (netgame || multiplayer) && displayplayer == consoleplayer) { - if (!splitscreen && G_GametypeUsesLives() && stplyr->lives <= 0 && countdown != 1) + if (!splitscreen && gametype != GT_COOP && G_GametypeUsesLives() && stplyr->lives <= 0 && countdown != 1) V_DrawCenteredString(BASEVIDWIDTH/2, 132, 0, M_GetText("Press F12 to watch another player.")); else if (gametype == GT_HIDEANDSEEK && (!stplyr->spectator && !(stplyr->pflags & PF_TAGIT)) && (leveltime > hidetime * TICRATE)) @@ -2010,8 +2010,8 @@ static void ST_overlayDrawer(void) if (G_GametypeHasTeams()) V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(132), V_HUDTRANSHALF, M_GetText("Press Fire to be assigned to a team.")); else if (G_IsSpecialStage(gamemap) && useNightsSS) - V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(132), V_HUDTRANSHALF, M_GetText("You cannot join the game until the stage has ended.")); - else if (gametype == GT_COOP) + V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(132), V_HUDTRANSHALF, M_GetText("You cannot play until the stage has ended.")); + else if (gametype == GT_COOP && stplyr->lives <= 0) { if (cv_cooplives.value == 1 && (netgame || multiplayer))