Have HU_DrawRankings and K_drawKartPositionFaces learn a thing or two from each other, considering the latter was originally copypasted code from the former but then diverged a bit.

Hopefully this solves our disconnect woes.
This commit is contained in:
toaster 2018-10-30 23:01:17 +00:00
parent c71e71a4b4
commit bac297b658
2 changed files with 9 additions and 6 deletions

View file

@ -2733,7 +2733,7 @@ static void HU_DrawRankings(void)
tab[i].name = NULL;
tab[i].count = INT32_MAX;
if (!playeringame[i] || players[i].spectator)
if (!playeringame[i] || players[i].spectator || !players[i].mo)
continue;
numplayersingame++;
@ -2744,7 +2744,7 @@ static void HU_DrawRankings(void)
UINT8 lowestposition = MAXPLAYERS;
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i] || players[i].spectator || completed[i])
if (completed[i] || !playeringame[i] || players[i].spectator || !players[i].mo)
continue;
if (players[i].kartstuff[k_position] >= lowestposition)

View file

@ -6431,16 +6431,19 @@ static boolean K_drawKartPositionFaces(void)
for (j = 0; j < numplayersingame; j++)
{
UINT8 lowestposition = MAXPLAYERS;
for (i = 0; i < MAXPLAYERS; i++)
{
if (completed[i] || !playeringame[i] || players[i].spectator || !players[i].mo)
continue;
if (rankplayer[ranklines] < 0 || players[i].kartstuff[k_position] < players[rankplayer[ranklines]].kartstuff[k_position])
{
rankplayer[ranklines] = i;
}
if (players[i].kartstuff[k_position] >= lowestposition)
continue;
rankplayer[ranklines] = i;
lowestposition = players[i].kartstuff[k_position];
}
i = rankplayer[ranklines];
completed[i] = true;