From 5371e3ba7f091698585f5ecd2e519120ac1ddc3a Mon Sep 17 00:00:00 2001 From: havoc Date: Thu, 13 Jan 2005 06:36:57 +0000 Subject: [PATCH] shuffled around some SCR_BeginLoadingPlaque calls so now SV_SpawnServer causes a loading plaque and ParseServerinfo only draws a loading plaque if there's no local server (which already did one), this cleans up the loading plaque management a great deal git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4926 d7cf8633-e32d-0410-b094-e92efae38249 --- cl_parse.c | 7 ++++++- host_cmd.c | 6 ------ sv_main.c | 3 +++ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/cl_parse.c b/cl_parse.c index 9989bc3c..101dee0f 100644 --- a/cl_parse.c +++ b/cl_parse.c @@ -354,7 +354,7 @@ void CL_ParseServerInfo (void) cl.maxclients = MSG_ReadByte (); if (cl.maxclients < 1 || cl.maxclients > MAX_SCOREBOARD) { - Con_Printf("Bad maxclients (%u) from server\n", cl.maxclients); + Host_Error("Bad maxclients (%u) from server\n", cl.maxclients); return; } Mem_EmptyPool(cl_scores_mempool); @@ -374,6 +374,11 @@ void CL_ParseServerInfo (void) // check memory integrity Mem_CheckSentinelsGlobal(); + S_StopAllSounds(); + // if server is active, we already began a loading plaque + if (!sv.active) + SCR_BeginLoadingPlaque(); + // disable until we get textures for it R_ResetSkyBox(); diff --git a/host_cmd.c b/host_cmd.c index 1e67a8db..0ab60c24 100644 --- a/host_cmd.c +++ b/host_cmd.c @@ -276,7 +276,6 @@ void Host_Map_f (void) if (cmd_source != src_command) return; - SCR_BeginLoadingPlaque (); cls.demonum = -1; // stop demo loop in case this fails CL_Disconnect (); @@ -323,7 +322,6 @@ void Host_Changelevel_f (void) key_consoleactive = 0; SV_SaveSpawnparms (); - SCR_BeginLoadingPlaque(); allowcheats = sv_cheats.integer != 0; strcpy(level, Cmd_Argv(1)); SV_SpawnServer(level); @@ -359,7 +357,6 @@ void Host_Restart_f (void) key_dest = key_game; key_consoleactive = 0; - SCR_BeginLoadingPlaque(); allowcheats = sv_cheats.integer != 0; strcpy(mapname, sv.name); SV_SpawnServer(mapname); @@ -387,7 +384,6 @@ void Host_Reconnect_f (void) //Con_Print("reconnect: no signon, ignoring reconnect\n"); return; } - SCR_BeginLoadingPlaque(); cls.signon = 0; // need new connection messages } @@ -596,8 +592,6 @@ void Host_Loadgame_f (void) return; } - SCR_BeginLoadingPlaque (); - str = FS_Getline (f); for (i = 0;i < NUM_SPAWN_PARMS;i++) { diff --git a/sv_main.c b/sv_main.c index 73d2fdbe..8005c874 100644 --- a/sv_main.c +++ b/sv_main.c @@ -1607,6 +1607,9 @@ void SV_SpawnServer (const char *server) Con_DPrintf("SpawnServer: %s\n", server); + if (cls.state != ca_dedicated) + SCR_BeginLoadingPlaque(); + snprintf (modelname, sizeof(modelname), "maps/%s.bsp", server); worldmodel = Mod_ForName(modelname, false, true, true); if (!worldmodel || !worldmodel->TraceBox) -- 2.39.2