From a12503671b967ce28675aaf1c2057e91428ebdf7 Mon Sep 17 00:00:00 2001 From: havoc Date: Wed, 18 Feb 2009 22:31:39 +0000 Subject: [PATCH] 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 --- snd_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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) { -- 2.39.2