Change array size from MAXSKINS+1 to MAXSKINS+2

Also Set the values to 0/NULl, it will be overwritten later when a skin is assigned to the slot.
This commit is contained in:
Steel Titanium 2019-03-11 22:11:36 -04:00
parent b6572eceae
commit d6046088a0
No known key found for this signature in database
GPG key ID: 924BA411F18DFDBE
2 changed files with 9 additions and 3 deletions

View file

@ -514,10 +514,16 @@ const char *netxcmdnames[MAXNETXCMD - 1] =
*/
void D_RegisterServerCommands(void)
{
int i;
Forceskin_cons_t[0].value = -1;
Forceskin_cons_t[0].strvalue = "Off";
Forceskin_cons_t[MAXSKINS].value = 0;
Forceskin_cons_t[MAXSKINS].strvalue = NULL;
// Set the values to 0/NULl, it will be overwritten later when a skin is assigned to the slot.
for (i = 1; i < MAXSKINS; i++)
{
Forceskin_cons_t[i].value = 0;
Forceskin_cons_t[i].strvalue = NULL;
}
RegisterNetXCmd(XD_NAMEANDCOLOR, Got_NameAndColor);
RegisterNetXCmd(XD_WEAPONPREF, Got_WeaponPref);

View file

@ -40,7 +40,7 @@ int snprintf(char *str, size_t n, const char *fmt, ...);
//int vsnprintf(char *str, size_t n, const char *fmt, va_list ap);
#endif
CV_PossibleValue_t Forceskin_cons_t[MAXSKINS+1];
CV_PossibleValue_t Forceskin_cons_t[MAXSKINS+2];
static void R_InitSkins(void);