Added a "log_file" cvar to control the log file name (default: "" which means no...
[xonotic/darkplaces.git] / host.c
diff --git a/host.c b/host.c
index 4aea326..8a90463 100644 (file)
--- a/host.c
+++ b/host.c
@@ -98,34 +98,6 @@ cvar_t timeformat = {CVAR_SAVE, "timeformat", "[%b %e %X] "};
 
 /*
 ================
-Host_EndGame
-================
-*/
-void Host_EndGame (const char *format, ...)
-{
-       va_list argptr;
-       char string[1024];
-
-       va_start (argptr,format);
-       vsprintf (string,format,argptr);
-       va_end (argptr);
-       Con_DPrintf("Host_EndGame: %s\n",string);
-
-       Host_ShutdownServer (false);
-
-       if (cls.state == ca_dedicated)
-               Sys_Error ("Host_EndGame: %s\n",string);        // dedicated servers exit
-
-       if (cls.demonum != -1)
-               CL_NextDemo ();
-       else
-               CL_Disconnect ();
-
-       longjmp (host_abortserver, 1);
-}
-
-/*
-================
 Host_Error
 
 This shuts down both the client and server
@@ -502,11 +474,11 @@ void Host_ShutdownServer(qboolean crash)
        sizebuf_t buf;
        char message[4];
 
+       Con_DPrintf("Host_ShutdownServer\n");
+
        if (!sv.active)
                return;
 
-       Con_DPrintf("Host_ShutdownServer\n");
-
        // print out where the crash happened, if it was caused by QC
        PR_Crash();
 
@@ -934,6 +906,9 @@ void Host_Init (void)
                Cbuf_InsertText(va("timedemo %s\n", com_argv[i + 1]));
 
        Cbuf_Execute();
+
+       // We must wait for the log_file cvar to be initialized to start the log
+       Log_Start ();
 }