]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - snd_dma.c
fixed loadgame bug with edict references to later edicts (d was pointing at the old...
[xonotic/darkplaces.git] / snd_dma.c
index 7adfa7ae27a037f58ed866d0b5bc852cbeb75e10..6de33897f78545c8aa9e768ec390b9a7c4d2903b 100644 (file)
--- a/snd_dma.c
+++ b/snd_dma.c
@@ -689,11 +689,7 @@ void S_UpdateAmbientSounds (void)
        for (ambient_channel = 0 ; ambient_channel < NUM_AMBIENTS;ambient_channel++)
                channels[ambient_channel].sfx = NULL;
 
-       if (!snd_ambient || !cl.worldmodel || ambient_level.value <= 0)
-               return;
-
-       l = cl.worldmodel->PointInLeaf(cl.worldmodel, listener_origin);
-       if (!l)
+       if (!snd_ambient || ambient_level.value <= 0 || !cl.worldmodel || !cl.worldmodel->brushq1.PointInLeaf || (l = cl.worldmodel->brushq1.PointInLeaf(cl.worldmodel, listener_origin)) == NULL)
                return;
 
 // calc ambient sound levels