fix crash when tails tails dont have a tails to be the tail of

This commit is contained in:
kaldrum1 2024-07-10 21:14:11 -07:00
parent eefcca6259
commit 147aa123f9

View file

@ -1201,7 +1201,7 @@ static INT32 GetAnimDuration(mobj_t *mobj) //part of p_mobj's setplayermobjstate
if (!(mobj->frame & FF_ANIMATE) && mobj->anim_duration) //set manually by something through lua if (!(mobj->frame & FF_ANIMATE) && mobj->anim_duration) //set manually by something through lua
return mobj->anim_duration; return mobj->anim_duration;
if (!player && mobj->type == MT_TAILSOVERLAY) //so tails overlays interpolate properly if (!player && mobj->type == MT_TAILSOVERLAY && mobj->tracer) //so tails overlays interpolate properly
player = mobj->tracer->player; player = mobj->tracer->player;
if (player) if (player)
{ {
@ -1691,7 +1691,6 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
HWD.pfnDrawModel(md2->model, frame, durs, tics, nextFrame, &p, md2->scale * xs, md2->scale * ys, flip, hflip, &Surf); HWD.pfnDrawModel(md2->model, frame, durs, tics, nextFrame, &p, md2->scale * xs, md2->scale * ys, flip, hflip, &Surf);
} }
} }
return true; return true;
} }