From: havoc Date: Wed, 18 Feb 2009 22:31:39 +0000 (+0000) Subject: fix bug introduced by div0 that made entities belonging to world play at X-Git-Tag: xonotic-v0.1.0preview~1856 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a12503671b967ce28675aaf1c2057e91428ebdf7;p=xonotic%2Fdarkplaces.git fix bug introduced by div0 that made entities belonging to world play at world origin added special case for removed entities - channel entity is changed to world when this is detected git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8739 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/snd_main.c b/snd_main.c index 0cb1bb69..5f676678 100644 --- a/snd_main.c +++ b/snd_main.c @@ -1254,8 +1254,9 @@ 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]); - if(ch->entnum != 32768) // not for world - CL_VM_GetEntitySoundOrigin(ch->entnum, ch->origin); + if (ch->entnum > 32768) + if (!CL_VM_GetEntitySoundOrigin(ch->entnum, ch->origin)) + ch->entnum = 32768; // entity was removed, disown sound } else if (cl.entities[ch->entnum].state_current.active) {