engine: client: don't go out of bounds if studio model don't have any sequences

Fixes models/null.mdl in Master Sword Rebirth. It's technically a valid model, though
completely useless for renderer.
This commit is contained in:
Alibek Omarov 2024-11-07 07:13:16 +03:00
parent 0adda483c5
commit 6a2a2c33ee

View file

@ -268,7 +268,7 @@ static float CL_GetStudioEstimatedFrame( cl_entity_t *ent )
{
pstudiohdr = (studiohdr_t *)Mod_StudioExtradata( ent->model );
if( pstudiohdr )
if( pstudiohdr && pstudiohdr->numseq > 0 )
{
sequence = bound( 0, ent->curstate.sequence, pstudiohdr->numseq - 1 );
pseqdesc = (mstudioseqdesc_t *)((byte *)pstudiohdr + pstudiohdr->seqindex) + sequence;