Fix the egregrious bugs from our last testing netgame.

* Made Got_Teamchange's level-based stuff only happen in GS_LEVEL.
* If, by chance, DoTimeOver gets called on a player without an object, it won't crash either.
* Make ending music play when you get time overed.
* Make changing-to-spectators get removed from the intermission drawer.
This commit is contained in:
toaster 2018-07-19 01:27:36 +01:00
parent f6a00cc60e
commit 7e0d5a479c
3 changed files with 13 additions and 10 deletions

View file

@ -3232,6 +3232,9 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
}
}
if (gamestate != GS_LEVEL)
return;
// Clear player score and rings if a spectator.
if (players[playernum].spectator)
{

View file

@ -9065,9 +9065,14 @@ void P_DoTimeOver(player_t *player)
&& !demoplayback)
legitimateexit = true; // SRB2kart: losing a race is still seeing it through to the end :p
S_StopSound(player->mo);
P_DamageMobj(player->mo, NULL, NULL, 10000);
if (player->mo)
{
S_StopSound(player->mo);
P_DamageMobj(player->mo, NULL, NULL, 10000);
}
player->lives = 0;
P_EndingMusic(player);
}
//

View file

@ -337,9 +337,6 @@ void Y_IntermissionDrawer(void)
char name[MAXPLAYERNAME+1];
const char *timeheader = (intertype == int_race) ? "TIME" : "HITS";
boolean completed[MAXPLAYERS];
memset(completed, 0, sizeof (completed));
// draw the level name
V_DrawCenteredString(-4 + x + BASEVIDWIDTH/2, 20, 0, data.match.levelstring);
V_DrawFill(x, 42, 312, 1, 0);
@ -369,12 +366,12 @@ void Y_IntermissionDrawer(void)
for (i = 0; i < data.match.numplayers; i++)
{
V_DrawCenteredString(x+6, y, 0, va("%d", data.match.pos[i]));
if (data.match.num[i] != MAXPLAYERS && playeringame[data.match.num[i]])
if (data.match.num[i] != MAXPLAYERS && playeringame[data.match.num[i]] && !players[data.match.num[i]].spectator)
{
char strtime[10];
V_DrawCenteredString(x+6, y, 0, va("%d", data.match.pos[i]));
if (data.match.color[i] == 0)
V_DrawSmallScaledPatch(x+16, y-4, 0,faceprefix[*data.match.character[i]]);
else
@ -442,8 +439,6 @@ void Y_IntermissionDrawer(void)
}
}
}
completed[i] = true;
}
else
data.match.num[i] = MAXPLAYERS;