]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - host.c
menu.c - changed M_DrawSlider to take a value and a min/max range, now prints the...
[xonotic/darkplaces.git] / host.c
diff --git a/host.c b/host.c
index 7233970b719aaa728dcc2493a4f23c36fcb702f1..3ac0f7e03f84eee8eda861ab3901540e40c94f5e 100644 (file)
--- a/host.c
+++ b/host.c
@@ -133,11 +133,17 @@ This shuts down both the client and server
 ================
 */
 char hosterrorstring[4096];
+extern char sv_spawnmap[MAX_QPATH];
+extern char sv_loadgame[MAX_OSPATH];
 void Host_Error (const char *error, ...)
 {
        va_list argptr;
        static qboolean inerror = false;
 
+       // make sure we don't get in a loading loop
+       sv_loadgame[0] = 0;
+       sv_spawnmap[0] = 0;
+
        // LordHavoc: if first frame has not been shown, or currently shutting
        // down, do Sys_Error instead
        if (!host_loopactive || host_shuttingdown)
@@ -164,6 +170,8 @@ void Host_Error (const char *error, ...)
        va_end (argptr);
        Con_Printf ("Host_Error: %s\n",hosterrorstring);
 
+       CL_Parse_DumpPacket();
+
        PR_Crash();
 
        if (sv.active)
@@ -175,6 +183,9 @@ void Host_Error (const char *error, ...)
        CL_Disconnect ();
        cls.demonum = -1;
 
+       // unload any partially loaded models
+       Mod_ClearErrorModels();
+
        inerror = false;
 
        longjmp (host_abortserver, 1);
@@ -821,11 +832,11 @@ void Host_Frame (float time)
 
        time1 = Sys_DoubleTime ();
        _Host_Frame (time);
-       time2 = Sys_DoubleTime ();      
-       
+       time2 = Sys_DoubleTime ();
+
        timetotal += time2 - time1;
        timecount++;
-       
+
        if (timecount < 1000)
                return;
 
@@ -887,7 +898,6 @@ void Host_Init (void)
 
        if (cls.state != ca_dedicated)
        {
-               Gamma_Init();
                Palette_Init();
                VID_Shared_Init();
                VID_Init();
@@ -905,8 +915,8 @@ void Host_Init (void)
        Cbuf_Execute ();
 
        host_initialized = true;
-       
-       Con_Printf ("========Quake Initialized=========\n");    
+
+       Con_Printf ("========Quake Initialized=========\n");
 
        if (cls.state != ca_dedicated)
                VID_Open();
@@ -924,15 +934,15 @@ to run quit through here before the final handoff to the sys code.
 void Host_Shutdown(void)
 {
        static qboolean isdown = false;
-       
+
        if (isdown)
        {
-               printf ("recursive shutdown\n");
+               Con_Printf ("recursive shutdown\n");
                return;
        }
        isdown = true;
 
-       Host_WriteConfiguration (); 
+       Host_WriteConfiguration ();
 
        CDAudio_Shutdown ();
        NET_Shutdown ();