cache player

This commit is contained in:
Alug committed 2025-03-16 12:23:16 +01:00
1 parent 6c837f6fb6
commit 84ac034fa9
1 file changed
+6 -4
+6 -4
View File
@@ -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)<<FRACBITS);
amypos = amnumypos + ((y + (SHORT(minimapinfo.minimap_pic->height)-SHORT(minimaphead->height)) / 2)<<FRACBITS);
if (cv_showminimapnames.value && mo->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)