X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=snd_main.c;h=cf82a6d7481094b444391f266e983d3260308391;hb=22cb365eac64641816ec25c81fbacceb7bc655fa;hp=ede502866e66f32e7f3ae39002ad197e18f11ae5;hpb=62c43210bbadc9d48425b4aa2950ff9260e1458c;p=xonotic%2Fdarkplaces.git diff --git a/snd_main.c b/snd_main.c index ede50286..cf82a6d7 100644 --- a/snd_main.c +++ b/snd_main.c @@ -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;