From 6f5a0b9a3f0a8775b7e111ad2d3ca4e3ed55a2a4 Mon Sep 17 00:00:00 2001 From: Alug Date: Fri, 27 Dec 2024 00:34:51 +0100 Subject: [PATCH] also add playernum var to tabrankings drawer --- src/k_kart.c | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index a6aa76e4d..3c1b51c07 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -8582,13 +8582,14 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I for (i = 0; i < scorelines; i++) { char strtime[MAXPLAYERNAME+1]; + const UINT8 pnum = tab[i].num; - if (players[tab[i].num].spectator || !players[tab[i].num].mo) + if (players[pnum].spectator || !players[pnum].mo) continue; //ignore them. if (netgame // don't draw it offline - && tab[i].num != serverplayer) - HU_drawPing(x + ((i < 8) ? -17 : rightoffset + 11), y-4, playerpingtable[tab[i].num], 0); + && pnum != serverplayer) + HU_drawPing(x + ((i < 8) ? -17 : rightoffset + 11), y-4, playerpingtable[pnum], 0); STRBUFCPY(strtime, tab[i].name); @@ -8597,27 +8598,28 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I else V_DrawString(x + 20, y, ((tab[i].num == whiteplayer) ? hilicol : 0)|V_ALLOWLOWERCASE, strtime); - if (players[tab[i].num].mo->color) + if (players[pnum].mo->color) { - colormap = R_GetTranslationColormap(players[tab[i].num].skin, players[tab[i].num].mo->color, GTC_CACHE); - if (players[tab[i].num].mo->colorized) - colormap = R_GetTranslationColormap(TC_RAINBOW, players[tab[i].num].mo->color, GTC_CACHE); + colormap = R_GetTranslationColormap(players[pnum].skin, players[pnum].mo->color, GTC_CACHE); + + if (players[pnum].mo->colorized) + colormap = R_GetTranslationColormap(TC_RAINBOW, players[pnum].mo->color, GTC_CACHE); else - colormap = R_GetTranslationColormap(players[tab[i].num].skin, players[tab[i].num].mo->color, GTC_CACHE); + colormap = R_GetTranslationColormap(players[pnum].skin, players[pnum].mo->color, GTC_CACHE); { player_t *p; - p = &players[tab[i].num]; + p = &players[pnum]; if (cv_highresportrait.value) V_DrawSmallMappedPatch(x, y-4, 0, R_GetSkinFaceWant(p), colormap); else V_DrawMappedPatch(x, y-4, 0, R_GetSkinFaceRank(p), colormap); } - /*if (G_BattleGametype() && players[tab[i].num].kartstuff[k_bumper] > 0) -- not enough space for this + /*if (G_BattleGametype() && players[pnum].kartstuff[k_bumper] > 0) -- not enough space for this { INT32 bumperx = x+19; V_DrawMappedPatch(bumperx-2, y-4, 0, kp_tinybumper[0], colormap); - for (j = 1; j < players[tab[i].num].kartstuff[k_bumper]; j++) + for (j = 1; j < players[pnum].kartstuff[k_bumper]; j++) { bumperx += 5; V_DrawMappedPatch(bumperx, y-4, 0, kp_tinybumper[1], colormap); @@ -8628,11 +8630,11 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I if (tab[i].num == whiteplayer) V_DrawScaledPatch(x, y-4, 0, kp_facehighlight[(leveltime / 4) % 8]); - if (G_BattleGametype() && players[tab[i].num].kartstuff[k_bumper] <= 0) + if (G_BattleGametype() && players[pnum].kartstuff[k_bumper] <= 0) V_DrawScaledPatch(x-4, y-7, 0, kp_ranknobumpers); else { - INT32 pos = players[tab[i].num].kartstuff[k_position]; + INT32 pos = players[pnum].kartstuff[k_position]; if (pos < 0 || pos > MAXPLAYERS) pos = 0; // Draws the little number over the face @@ -8644,18 +8646,18 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I #define timestring(time) va("%i'%02i\"%02i", G_TicsToMinutes(time, true), G_TicsToSeconds(time), G_TicsToCentiseconds(time)) if (scorelines > 8) { - if (players[tab[i].num].exiting) - V_DrawRightAlignedThinString(x+rightoffset, y-1, hilicol|V_6WIDTHSPACE, timestring(players[tab[i].num].realtime)); - else if (players[tab[i].num].pflags & PF_TIMEOVER) + if (players[pnum].exiting) + V_DrawRightAlignedThinString(x+rightoffset, y-1, hilicol|V_6WIDTHSPACE, timestring(players[pnum].realtime)); + else if (players[pnum].pflags & PF_TIMEOVER) V_DrawRightAlignedThinString(x+rightoffset, y-1, V_6WIDTHSPACE, "NO CONTEST."); else if (circuitmap) V_DrawRightAlignedThinString(x+rightoffset, y-1, V_6WIDTHSPACE, va("Lap %d", tab[i].count)); } else { - if (players[tab[i].num].exiting) - V_DrawRightAlignedString(x+rightoffset, y, hilicol, timestring(players[tab[i].num].realtime)); - else if (players[tab[i].num].pflags & PF_TIMEOVER) + if (players[pnum].exiting) + V_DrawRightAlignedString(x+rightoffset, y, hilicol, timestring(players[pnum].realtime)); + else if (players[pnum].pflags & PF_TIMEOVER) V_DrawRightAlignedThinString(x+rightoffset, y-1, 0, "NO CONTEST."); else if (circuitmap) V_DrawRightAlignedString(x+rightoffset, y, 0, va("Lap %d", tab[i].count));