From: havoc Date: Mon, 25 Oct 2004 07:35:08 +0000 (+0000) Subject: fix a rare crash when a sound is emitted by an entity with a model whose precache... X-Git-Tag: xonotic-v0.1.0preview~5424 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1d8c8c5a523aa68572a0a90970f9fccb0f153d1e;p=xonotic%2Fdarkplaces.git fix a rare crash when a sound is emitted by an entity with a model whose precache pointer is NULL, apparently this happens in the Fiend Run Lite demos git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4705 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/snd_main.c b/snd_main.c index df07f8df..542caa61 100644 --- a/snd_main.c +++ b/snd_main.c @@ -467,7 +467,7 @@ void SND_Spatialize(channel_t *ch, qboolean isstatic) { //Con_Printf("-- entnum %i origin %f %f %f neworigin %f %f %f\n", ch->entnum, ch->origin[0], ch->origin[1], ch->origin[2], cl_entities[ch->entnum].state_current.origin[0], cl_entities[ch->entnum].state_current.origin[1], cl_entities[ch->entnum].state_current.origin[2]); VectorCopy(cl_entities[ch->entnum].state_current.origin, ch->origin); - if (cl_entities[ch->entnum].state_current.modelindex && cl.model_precache[cl_entities[ch->entnum].state_current.modelindex]->soundfromcenter) + if (cl_entities[ch->entnum].state_current.modelindex && cl.model_precache[cl_entities[ch->entnum].state_current.modelindex] && cl.model_precache[cl_entities[ch->entnum].state_current.modelindex]->soundfromcenter) VectorMAMAM(1.0f, ch->origin, 0.5f, cl.model_precache[cl_entities[ch->entnum].state_current.modelindex]->normalmins, 0.5f, cl.model_precache[cl_entities[ch->entnum].state_current.modelindex]->normalmaxs, ch->origin); }