]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - snd_main.c
fixed makefile (it is not possible to comment out lines with \ at the end)
[xonotic/darkplaces.git] / snd_main.c
index ede502866e66f32e7f3ae39002ad197e18f11ae5..cf82a6d7481094b444391f266e983d3260308391 100644 (file)
@@ -365,7 +365,7 @@ void S_ServerSounds (char serversound [][MAX_QPATH], unsigned int numsounds)
        for (sfx = known_sfx;sfx;sfx = sfxnext)
        {
                sfxnext = sfx->next;
-               S_FreeSfx (sfx);
+               S_FreeSfx (sfx, false);
        }
 }
 
@@ -515,6 +515,7 @@ void SND_Spatialize(channel_t *ch, qboolean isstatic)
                // calculate the volumes
                ch->leftvol = (int) (scale + pan);
                ch->rightvol = (int) (scale - pan);
+               //Con_Printf("%f %f %f:%f %f %f:%f %f:%d %d\n", ch->origin[0], ch->origin[1], ch->origin[2], source_vec[0], source_vec[1], source_vec[2], scale, pan, ch->leftvol, ch->rightvol);
        }
 
        // Adjust volume of static sounds
@@ -574,6 +575,9 @@ int S_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float f
                return -1;
        }
 
+       if (entnum && entnum >= cl_max_entities)
+               CL_ExpandEntities(entnum);
+
        // Pick a channel to play on
        target_chan = SND_PickChannel(entnum, entchannel);
        if (!target_chan)
@@ -1052,7 +1056,7 @@ qboolean S_LocalSound (const char *sound)
        // Local sounds must not be freed
        sfx->flags |= SFXFLAG_PERMANENTLOCK;
 
-       ch_ind = S_StartSound (cl.viewentity, 0, sfx, vec3_origin, 1, 1);
+       ch_ind = S_StartSound (cl.viewentity, 0, sfx, vec3_origin, 1, 0);
        if (ch_ind < 0)
                return false;