check if minimaphead exists
hopefully fixes a random crash there
This commit is contained in:
1 parent
726237b42c
commit
f8f18ea12f
1 file changed
+7
-4
+7
-4
@@ -3508,7 +3508,7 @@ static void K_drawKartMinimapIcon(fixed_t objx, fixed_t objy, INT32 hudx, INT32
|
||||
fixed_t amnumxpos, amnumypos;
|
||||
INT32 amxpos, amypos;
|
||||
fixed_t scale = FRACUNIT;
|
||||
patch_t *AutomapPic;
|
||||
patch_t *AutomapPic = NULL;
|
||||
INT16 w, h;
|
||||
|
||||
AutomapPic = minimapinfo.minimap_pic;
|
||||
@@ -3565,7 +3565,6 @@ static void K_drawKartMinimapHead(mobj_t *mo, INT32 x, INT32 y, INT32 flags)
|
||||
INT32 amxpos, amypos, wntdamxpos, wntdamypos;
|
||||
fixed_t scale = FRACUNIT;
|
||||
patch_t *minimaphead = NULL;
|
||||
boolean minihead = K_useSmallMinimapHead(mo->player);
|
||||
|
||||
#ifdef ROTSPRITE
|
||||
angle_t rollangle = 0;
|
||||
@@ -3575,6 +3574,9 @@ static void K_drawKartMinimapHead(mobj_t *mo, INT32 x, INT32 y, INT32 flags)
|
||||
skin = K_GetMobjSkin(mo);
|
||||
minimaphead = (skinlocal ? localfacemmapprefix : facemmapprefix)[K_GetMobjSkinNum(skin, skinlocal)];
|
||||
|
||||
if (minimaphead == NULL)
|
||||
return;
|
||||
|
||||
amnumxpos = (FixedMul(lerp(mo->old_x, mo->x), minimapinfo.zoom) - minimapinfo.offs_x);
|
||||
amnumypos = -(FixedMul(lerp(mo->old_y, mo->y), minimapinfo.zoom) - minimapinfo.offs_y);
|
||||
|
||||
@@ -3589,6 +3591,7 @@ static void K_drawKartMinimapHead(mobj_t *mo, INT32 x, INT32 y, INT32 flags)
|
||||
V_DrawCenteredSmallStringAtFixed(amxpos + (4*FRACUNIT), amypos - (3*FRACUNIT), V_ALLOWLOWERCASE|flags|V_SkinColorToHighlightcolor(mo->color), player_names[player - players]);
|
||||
}
|
||||
|
||||
const boolean minihead = K_useSmallMinimapHead(mo->player);
|
||||
|
||||
// thx wanted reticle for having weird offsets very cool
|
||||
wntdamxpos = minihead ? amxpos + (1<<FRACBITS) : amxpos - (4<<FRACBITS);
|
||||
@@ -3758,7 +3761,7 @@ static void K_drawKartMinimap(void)
|
||||
splitflags |= V_HUDTRANS;
|
||||
|
||||
const SINT8 icondotradius = ((cv_minihead.value == 1) && !cv_showminimapnames.value) ? 8 : 10;
|
||||
patch_t* minipatch;
|
||||
patch_t* minipatch = NULL;
|
||||
INT32 rot;
|
||||
INT32 blending;
|
||||
|
||||
@@ -3806,7 +3809,7 @@ static void K_drawKartMinimap(void)
|
||||
else if (cv_showminimapangle.value == MINIANGLE_LIGHT)
|
||||
{
|
||||
rot = R_GetRollAngle(ang);
|
||||
minipatch = W_CachePatchNameRotated("MMAPHDLT", rot, PU_PATCH);
|
||||
minipatch = (patch_t *)W_CachePatchNameRotated("MMAPHDLT", rot, PU_PATCH);
|
||||
|
||||
blending = B_ADD;
|
||||
xoff = yoff = 0;
|
||||
|
||||
Reference in new issue
Block a user