From: lordhavoc Date: Sat, 28 Oct 2000 18:49:33 +0000 (+0000) Subject: recursive host_error improvement (prints both error messages) X-Git-Tag: RELEASE_0_2_0_RC1~953 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=commitdiff_plain;h=2e767728260f0b44523d5ae43af81f95913f521b recursive host_error improvement (prints both error messages) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@67 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/host.c b/host.c index 2c9cdd5e..e9c697ea 100644 --- a/host.c +++ b/host.c @@ -118,28 +118,34 @@ Host_Error This shuts down both the client and server ================ */ +char hosterrorstring[1024]; void Host_Error (char *error, ...) { va_list argptr; - char string[1024]; static qboolean inerror = false; if (inerror) - Sys_Error ("Host_Error: recursively entered"); + { + char string[1024]; + va_start (argptr,error); + vsprintf (string,error,argptr); + va_end (argptr); + Sys_Error ("Host_Error: recursively entered (original error was: %s new error is: %s)", hosterrorstring, string); + } inerror = true; SCR_EndLoadingPlaque (); // reenable screen updates va_start (argptr,error); - vsprintf (string,error,argptr); + vsprintf (hosterrorstring,error,argptr); va_end (argptr); - Con_Printf ("Host_Error: %s\n",string); + Con_Printf ("Host_Error: %s\n",hosterrorstring); if (sv.active) Host_ShutdownServer (false); if (cls.state == ca_dedicated) - Sys_Error ("Host_Error: %s\n",string); // dedicated servers exit + Sys_Error ("Host_Error: %s\n",hosterrorstring); // dedicated servers exit CL_Disconnect (); cls.demonum = -1; @@ -359,7 +365,7 @@ void SV_DropClient (qboolean crash) NET_SendMessage (host_client->netconnection, &host_client->message); } - if (host_client->edict && host_client->spawned) + if (sv.active && host_client->edict && host_client->spawned) // LordHavoc: don't call QC if server is dead (avoids recursive Host_Error in some mods when they run out of edicts) { // call the prog function for removing a client // this will set the body to a dead frame, among other things