mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 13:47:58 +03:00
Avoid creating a new sound index when there is no active client
This commit is contained in:
parent
a5691d7779
commit
40492daecd
1 changed files with 9 additions and 1 deletions
|
@ -70,9 +70,17 @@ void SV_Sound( vec3_t *org, int entnum, int channel, const char *sound_name, flo
|
|||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < sv_maxclients->integer; i++)
|
||||
for (i = 0; i < svs.iNumClients; i++)
|
||||
{
|
||||
client_t* client = &svs.clients[i];
|
||||
if (client->state != CS_ACTIVE) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (client->number_of_server_sounds >= MAX_SERVER_SOUNDS) {
|
||||
continue;
|
||||
}
|
||||
|
||||
SV_ClientSound(client, org, entnum, channel, SV_SoundIndex(sound_name, streamed), volume, mindist, pitch, maxdist, streamed);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue