simplify skinnum bounds check
lul
This commit is contained in:
1 parent
e17a8a505c
commit
c01818e2e3
1 file changed
+7
-12
+7
-12
@@ -7948,6 +7948,7 @@ static void M_DrawSetupMultiPlayerMenu(void)
|
||||
UINT8 i;
|
||||
UINT8 s, w;
|
||||
const UINT8 *flashcol = V_GetStringColormap(highlightflags);
|
||||
INT32 skinnum = 0;
|
||||
INT32 statx, staty;
|
||||
UINT32 speenframe;
|
||||
INT32 sltw, actw, hetw;
|
||||
@@ -8523,12 +8524,12 @@ static void M_DrawSetupMultiPlayerMenu(void)
|
||||
break;
|
||||
}
|
||||
|
||||
const INT32 skinnum = R_SkinAvailable(skins[skintodisplay].name);
|
||||
skinnum = R_SkinAvailable(skins[skintodisplay].name);
|
||||
|
||||
if (skinnum > 0 || skinnum < MAXSKINS)
|
||||
sprdef = &skins[skinnum].spritedef;
|
||||
else
|
||||
sprdef = &skins[0].spritedef;
|
||||
if (skinnum < 0 || skinnum >= MAXSKINS)
|
||||
skinnum = 0;
|
||||
|
||||
sprdef = &skins[skinnum].spritedef;
|
||||
|
||||
if (!sprdef->numframes) // No frames ??
|
||||
return; // Can't render!
|
||||
@@ -8557,14 +8558,8 @@ static void M_DrawSetupMultiPlayerMenu(void)
|
||||
if (setupm_fakecolor) // inverse should never happen
|
||||
{
|
||||
UINT8 *colormap = R_GetTranslationColormap(skintodisplay, setupm_fakecolor, GTC_MENUCACHE);
|
||||
|
||||
#ifdef HWRENDER
|
||||
md2_t *md2 = NULL;
|
||||
|
||||
if (skinnum > 0 || skinnum < MAXSKINS)
|
||||
md2 = &md2_playermodels[skinnum];
|
||||
else
|
||||
md2 = &md2_playermodels[0];
|
||||
md2_t *md2 = &md2_playermodels[skinnum];
|
||||
|
||||
// if we have 3d models enabled and a model exists
|
||||
// try to show it instead of the sprite
|
||||
|
||||
Reference in new issue
Block a user