]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - host.c
-Added Host_AbortCurrentFrame to hide the longjump and make it usable by
[xonotic/darkplaces.git] / host.c
diff --git a/host.c b/host.c
index da431962c29e18bea7ce6890a0b2604c3fe6d768..608f9c2b5b9ae2b5b5fa3c5ba55d62a1f8138528 100644 (file)
--- a/host.c
+++ b/host.c
@@ -93,6 +93,18 @@ cvar_t temp1 = {0, "temp1","0"};
 cvar_t timestamps = {CVAR_SAVE, "timestamps", "0"};
 cvar_t timeformat = {CVAR_SAVE, "timeformat", "[%b %e %X] "};
 
+/*
+================
+Host_AbortCurrentFrame
+
+aborts the current host frame and goes on with the next one
+================
+*/
+void Host_AbortCurrentFrame(void)
+{
+       longjmp (host_abortserver, 1);
+}
+
 /*
 ================
 Host_Error
@@ -100,12 +112,11 @@ Host_Error
 This shuts down both the client and server
 ================
 */
-void PRVM_ProcessError(void);
-static char hosterrorstring1[4096];
-static char hosterrorstring2[4096];
-static qboolean hosterror = false;
 void Host_Error (const char *error, ...)
 {
+       static char hosterrorstring1[4096];
+       static char hosterrorstring2[4096];
+       static qboolean hosterror = false;
        va_list argptr;
 
        va_start (argptr,error);
@@ -129,12 +140,9 @@ void Host_Error (const char *error, ...)
 
        //PR_Crash();
 
-       //PRVM_Crash(); // crash current prog
+       // print out where the crash happened, if it was caused by QC (and do a cleanup)
+       PRVM_Crash();
 
-       // crash all prvm progs
-       PRVM_CrashAll();
-
-       PRVM_ProcessError();
 
        Host_ShutdownServer (false);
 
@@ -146,7 +154,7 @@ void Host_Error (const char *error, ...)
 
        hosterror = false;
 
-       longjmp (host_abortserver, 1);
+       Host_AbortCurrentFrame();
 }
 
 void Host_ServerOptions (void)
@@ -488,8 +496,6 @@ void Host_ShutdownServer(qboolean crash)
                return;
 
        SV_VM_Begin();
-       // print out where the crash happened, if it was caused by QC
-       //PRVM_Crash();
 
        NetConn_Heartbeat(2);
        NetConn_Heartbeat(2);
@@ -657,7 +663,6 @@ void Host_GetConsoleCommands (void)
        }
 }
 
-
 /*
 ==================
 Host_ServerFrame