mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-26 20:11:47 +00:00
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:
parent
c71e71a4b4
commit
bac297b658
2 changed files with 9 additions and 6 deletions
|
|
@ -2733,7 +2733,7 @@ static void HU_DrawRankings(void)
|
||||||
tab[i].name = NULL;
|
tab[i].name = NULL;
|
||||||
tab[i].count = INT32_MAX;
|
tab[i].count = INT32_MAX;
|
||||||
|
|
||||||
if (!playeringame[i] || players[i].spectator)
|
if (!playeringame[i] || players[i].spectator || !players[i].mo)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
numplayersingame++;
|
numplayersingame++;
|
||||||
|
|
@ -2744,7 +2744,7 @@ static void HU_DrawRankings(void)
|
||||||
UINT8 lowestposition = MAXPLAYERS;
|
UINT8 lowestposition = MAXPLAYERS;
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
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;
|
continue;
|
||||||
|
|
||||||
if (players[i].kartstuff[k_position] >= lowestposition)
|
if (players[i].kartstuff[k_position] >= lowestposition)
|
||||||
|
|
|
||||||
11
src/k_kart.c
11
src/k_kart.c
|
|
@ -6431,16 +6431,19 @@ static boolean K_drawKartPositionFaces(void)
|
||||||
|
|
||||||
for (j = 0; j < numplayersingame; j++)
|
for (j = 0; j < numplayersingame; j++)
|
||||||
{
|
{
|
||||||
|
UINT8 lowestposition = MAXPLAYERS;
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
{
|
{
|
||||||
if (completed[i] || !playeringame[i] || players[i].spectator || !players[i].mo)
|
if (completed[i] || !playeringame[i] || players[i].spectator || !players[i].mo)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (rankplayer[ranklines] < 0 || players[i].kartstuff[k_position] < players[rankplayer[ranklines]].kartstuff[k_position])
|
if (players[i].kartstuff[k_position] >= lowestposition)
|
||||||
{
|
continue;
|
||||||
rankplayer[ranklines] = i;
|
|
||||||
}
|
rankplayer[ranklines] = i;
|
||||||
|
lowestposition = players[i].kartstuff[k_position];
|
||||||
}
|
}
|
||||||
|
|
||||||
i = rankplayer[ranklines];
|
i = rankplayer[ranklines];
|
||||||
|
|
||||||
completed[i] = true;
|
completed[i] = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue