From 5099c056054ed7d98c21578429f78462cb7c583f Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Tue, 4 May 2004 21:59:17 +0000 Subject: [PATCH] bring back my stuttering fixes --- nq/source/cl_parse.c | 13 ++++++++----- nq/source/sv_ded.c | 10 ++++++++++ nq/source/sv_main.c | 3 +++ 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/nq/source/cl_parse.c b/nq/source/cl_parse.c index d15ca3176..ee8f37aa8 100644 --- a/nq/source/cl_parse.c +++ b/nq/source/cl_parse.c @@ -267,6 +267,7 @@ CL_ParseServerInfo (void) Con_DPrintf ("Serverinfo packet received.\n"); + S_BlockSound (); S_StopAllSounds (true); // wipe the client_state_t struct @@ -276,13 +277,13 @@ CL_ParseServerInfo (void) i = MSG_ReadLong (net_message); if (i != PROTOCOL_VERSION) { Con_Printf ("Server returned version %i, not %i", i, PROTOCOL_VERSION); - return; + goto done; } // 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); - return; + goto done; } cl.scores = Hunk_AllocName (cl.maxclients * sizeof (*cl.scores), "scores"); @@ -311,7 +312,7 @@ CL_ParseServerInfo (void) break; if (nummodels == MAX_MODELS) { Con_Printf ("Server sent too many model precaches\n"); - return; + goto done; } strcpy (model_precache[nummodels], str); Mod_TouchModel (str); @@ -325,7 +326,7 @@ CL_ParseServerInfo (void) break; if (numsounds == MAX_SOUNDS) { Con_Printf ("Server sent too many sound precaches\n"); - return; + goto done; } strcpy (sound_precache[numsounds], str); S_TouchSound (str); @@ -339,7 +340,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]); - return; + goto done; } CL_KeepaliveMessage (); } @@ -359,6 +360,8 @@ 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]; diff --git a/nq/source/sv_ded.c b/nq/source/sv_ded.c index 4db68f645..d6703f05c 100644 --- a/nq/source/sv_ded.c +++ b/nq/source/sv_ded.c @@ -353,6 +353,16 @@ V_Init_Cvars (void) { } +void +S_BlockSound (void) +{ +} + +void +S_UnblockSound (void) +{ +} + plugin_t *console_client_PluginInfo (void); plugin_t * console_client_PluginInfo (void) diff --git a/nq/source/sv_main.c b/nq/source/sv_main.c index f65614c9e..0cf5c596b 100644 --- a/nq/source/sv_main.c +++ b/nq/source/sv_main.c @@ -903,6 +903,7 @@ 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"); @@ -973,6 +974,7 @@ 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; @@ -1037,4 +1039,5 @@ SV_SpawnServer (const char *server) SV_SendServerinfo (host_client); Con_DPrintf ("Server spawned.\n"); + S_UnblockSound (); }