Crash prevention

This commit is contained in:
Jaime Passos 2019-09-03 21:31:32 -03:00
parent 916bdeb880
commit 4760ff0963
2 changed files with 2 additions and 10 deletions

View file

@ -1010,7 +1010,7 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
}
//FIXME: this is not yet correct
if (spr->mobj->sprite2)
if (spr->mobj->sprite2 && md2->model->spr2frames)
{
spr2 = (spr->mobj->sprite2 & ~FF_SPR2SUPER);
frame = (spr->mobj->frame & FF_FRAMEMASK);
@ -1025,7 +1025,7 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
#ifdef USE_MODEL_NEXTFRAME
if (cv_grmodels.value == 1 && tics <= durs)
{
if (spr->mobj->sprite2)
if (spr->mobj->sprite2 && md2->model->spr2frames)
{
if (HWR_CanInterpolateModel(spr->mobj))
{

View file

@ -224,20 +224,12 @@ model_t *LoadModel(const char *filename, int ztag)
void HWR_ReloadModels(void)
{
size_t i;
INT32 s;
for (s = 0; s < MAXSKINS; s++)
{
if (md2_playermodels[s].model)
LoadModelSprite2(md2_playermodels[s].model);
}
for (i = 0; i < NUMSPRITES; i++)
{
if (md2_models[i].model)
LoadModelSprite2(md2_models[i].model);
}
}
void LoadModelSprite2(model_t *model)