Fix some crashes

This commit is contained in:
lachablock 2021-08-09 17:30:05 +10:00
parent f9723a567c
commit f2472d88b8
2 changed files with 8 additions and 6 deletions

View file

@ -492,7 +492,7 @@ void HWR_InitModels(void)
CONS_Printf("HWR_InitModels()...\n");
if (numskins && md2_playermodels == NULL)
md2_playermodels = Z_Malloc(sizeof(md2_t), PU_STATIC, NULL);
md2_playermodels = Z_Malloc(sizeof(md2_t) * numskins, PU_STATIC, NULL);
for (s = 0; s < numskins; s++)
{

View file

@ -239,8 +239,10 @@ void HWR_ReloadModels(void)
size_t i;
INT32 s;
if (md2_playermodels != NULL)
for (s = 0; s < numskins; s++)
{
CONS_Printf("%u\n", s);
if (md2_playermodels[s].model)
LoadModelSprite2(md2_playermodels[s].model);
}