Grievre's patch to fix the sound channel leak.

This commit is contained in:
Bill Currie 2004-02-17 00:47:17 +00:00
parent 0360859a0f
commit 526605c99c
3 changed files with 6 additions and 21 deletions

View File

@ -266,7 +266,7 @@ CL_ParseServerInfo (void)
Con_DPrintf ("Serverinfo packet received.\n");
S_BlockSound ();
S_StopAllSounds (true);
// wipe the client_state_t struct
CL_ClearState ();
@ -275,13 +275,13 @@ CL_ParseServerInfo (void)
i = MSG_ReadLong (net_message);
if (i != PROTOCOL_VERSION) {
Con_Printf ("Server returned version %i, not %i", i, PROTOCOL_VERSION);
goto done;
return;
}
// parse maxclients
cl.maxclients = MSG_ReadByte (net_message);
if (cl.maxclients < 1 || cl.maxclients > MAX_SCOREBOARD) {
Con_Printf ("Bad maxclients (%u) from server\n", cl.maxclients);
goto done;
return;
}
cl.scores = Hunk_AllocName (cl.maxclients * sizeof (*cl.scores), "scores");
@ -310,7 +310,7 @@ CL_ParseServerInfo (void)
break;
if (nummodels == MAX_MODELS) {
Con_Printf ("Server sent too many model precaches\n");
goto done;
return;
}
strcpy (model_precache[nummodels], str);
Mod_TouchModel (str);
@ -324,7 +324,7 @@ CL_ParseServerInfo (void)
break;
if (numsounds == MAX_SOUNDS) {
Con_Printf ("Server sent too many sound precaches\n");
goto done;
return;
}
strcpy (sound_precache[numsounds], str);
S_TouchSound (str);
@ -338,7 +338,7 @@ CL_ParseServerInfo (void)
cl.model_precache[i] = Mod_ForName (model_precache[i], false);
if (cl.model_precache[i] == NULL) {
Con_Printf ("Model %s not found\n", model_precache[i]);
goto done;
return;
}
CL_KeepaliveMessage ();
}
@ -358,8 +358,6 @@ CL_ParseServerInfo (void)
noclip_anglehack = false; // noclip is turned off at start
r_gravity = 800.0; // Set up gravity for renderer effects
done:
S_UnblockSound ();
}
int bitcounts[16];

View File

@ -311,16 +311,6 @@ V_Init_Cvars (void)
{
}
void
S_BlockSound (void)
{
}
void
S_UnblockSound (void)
{
}
plugin_t *console_client_PluginInfo (void);
plugin_t *
console_client_PluginInfo (void)

View File

@ -903,7 +903,6 @@ SV_SpawnServer (const char *server)
int i;
edict_t *ent;
S_BlockSound ();
// let's not have any servers with no name
if (hostname->string[0] == 0)
Cvar_Set (hostname, "UNNAMED");
@ -975,7 +974,6 @@ SV_SpawnServer (const char *server)
if (!sv.worldmodel) {
Con_Printf ("Couldn't spawn server %s\n", sv.modelname);
sv.active = false;
S_UnblockSound ();
return;
}
sv.models[1] = sv.worldmodel;
@ -1040,5 +1038,4 @@ SV_SpawnServer (const char *server)
SV_SendServerinfo (host_client);
Con_DPrintf ("Server spawned.\n");
S_UnblockSound ();
}