From 84ac034fa9e0bdbc2231eb02fd0f16794bf0aefb Mon Sep 17 00:00:00 2001 From: Alug Date: Sat, 15 Mar 2025 16:47:11 +0100 Subject: [PATCH] cache player --- src/k_kart.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index cc428290d..7278f815e 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -10408,6 +10408,8 @@ static void K_drawKartMinimapHead(mobj_t *mo, INT32 x, INT32 y, INT32 flags) // am xpos & ypos are the icon's starting position. Without // it, they wouldn't 'spawn' on the top-right side of the HUD. + player_t *player = mo->player; + UINT8 skinnum = 0; const boolean skinlocal = mo->skinlocal; const skin_t *skin = (skin_t*)(mo->localskin ? mo->localskin : mo->skin); @@ -10436,9 +10438,9 @@ static void K_drawKartMinimapHead(mobj_t *mo, INT32 x, INT32 y, INT32 flags) amxpos = amnumxpos + ((x + (SHORT(minimapinfo.minimap_pic->width)-SHORT(minimaphead->width)) / 2)<height)-SHORT(minimaphead->height)) / 2)<player && !(modeattacking || gamestate == GS_TIMEATTACK)) + if (cv_showminimapnames.value && player && !(modeattacking || gamestate == GS_TIMEATTACK)) { - V_DrawCenteredSmallStringAtFixed(amxpos + (4*FRACUNIT), amypos - (3*FRACUNIT), V_ALLOWLOWERCASE|flags|V_SkinColorToHighlightcolor(mo->color), player_names[mo->player - players]); + V_DrawCenteredSmallStringAtFixed(amxpos + (4*FRACUNIT), amypos - (3*FRACUNIT), V_ALLOWLOWERCASE|flags|V_SkinColorToHighlightcolor(mo->color), player_names[player - players]); } // thx wanted reticle for having weird offsets very cool @@ -10453,10 +10455,10 @@ static void K_drawKartMinimapHead(mobj_t *mo, INT32 x, INT32 y, INT32 flags) } #ifdef ROTSPRITE - if (cv_spinoutroll.value && mo->player && mo->player->spinoutrot) + if (cv_spinoutroll.value && player && player->spinoutrot) { // Rotate counterclockwise. - rollangle = FixedAngle(mo->player->spinoutrot * -1); + rollangle = FixedAngle(player->spinoutrot * -1); rot = R_GetRollAngle(rollangle); if (rot)