mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-12-11 21:32:17 +00:00
Crash prevention
This commit is contained in:
parent
916bdeb880
commit
4760ff0963
2 changed files with 2 additions and 10 deletions
|
@ -1010,7 +1010,7 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
|
||||||
}
|
}
|
||||||
|
|
||||||
//FIXME: this is not yet correct
|
//FIXME: this is not yet correct
|
||||||
if (spr->mobj->sprite2)
|
if (spr->mobj->sprite2 && md2->model->spr2frames)
|
||||||
{
|
{
|
||||||
spr2 = (spr->mobj->sprite2 & ~FF_SPR2SUPER);
|
spr2 = (spr->mobj->sprite2 & ~FF_SPR2SUPER);
|
||||||
frame = (spr->mobj->frame & FF_FRAMEMASK);
|
frame = (spr->mobj->frame & FF_FRAMEMASK);
|
||||||
|
@ -1025,7 +1025,7 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
|
||||||
#ifdef USE_MODEL_NEXTFRAME
|
#ifdef USE_MODEL_NEXTFRAME
|
||||||
if (cv_grmodels.value == 1 && tics <= durs)
|
if (cv_grmodels.value == 1 && tics <= durs)
|
||||||
{
|
{
|
||||||
if (spr->mobj->sprite2)
|
if (spr->mobj->sprite2 && md2->model->spr2frames)
|
||||||
{
|
{
|
||||||
if (HWR_CanInterpolateModel(spr->mobj))
|
if (HWR_CanInterpolateModel(spr->mobj))
|
||||||
{
|
{
|
||||||
|
|
|
@ -224,20 +224,12 @@ model_t *LoadModel(const char *filename, int ztag)
|
||||||
|
|
||||||
void HWR_ReloadModels(void)
|
void HWR_ReloadModels(void)
|
||||||
{
|
{
|
||||||
size_t i;
|
|
||||||
INT32 s;
|
INT32 s;
|
||||||
|
|
||||||
for (s = 0; s < MAXSKINS; s++)
|
for (s = 0; s < MAXSKINS; s++)
|
||||||
{
|
{
|
||||||
if (md2_playermodels[s].model)
|
if (md2_playermodels[s].model)
|
||||||
LoadModelSprite2(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)
|
void LoadModelSprite2(model_t *model)
|
||||||
|
|
Loading…
Reference in a new issue