Fix skins overflow

This commit is contained in:
Steel Titanium 2019-01-15 14:29:43 -05:00
parent 4f0be1b064
commit fad341b0e9
2 changed files with 3 additions and 3 deletions

View File

@ -2306,7 +2306,7 @@ void R_DrawMasked(void)
// ==========================================================================
INT32 numskins = 0;
skin_t skins[MAXSKINS+1];
skin_t skins[MAXSKINS];
// FIXTHIS: don't work because it must be inistilised before the config load
//#define SKINVALUES
#ifdef SKINVALUES
@ -2559,7 +2559,7 @@ void R_AddSkins(UINT16 wadnum)
// advance by default
lastlump = lump + 1;
if (numskins > MAXSKINS)
if (numskins >= MAXSKINS)
{
CONS_Debug(DBG_RENDER, "ignored skin (%d skins maximum)\n", MAXSKINS);
continue; // so we know how many skins couldn't be added

View File

@ -180,7 +180,7 @@ typedef struct drawnode_s
} drawnode_t;
extern INT32 numskins;
extern skin_t skins[MAXSKINS + 1];
extern skin_t skins[MAXSKINS];
void SetPlayerSkin(INT32 playernum,const char *skinname);
void SetPlayerSkinByNum(INT32 playernum,INT32 skinnum); // Tails 03-16-2002