fix some problems with error printing, especially when using the curses

console
This commit is contained in:
Bill Currie 2002-04-10 21:03:02 +00:00
parent 03ab75704f
commit 0d525189f4
2 changed files with 13 additions and 6 deletions

View file

@ -69,6 +69,7 @@ static const char rcsid[] =
#include "QF/cmd.h"
#include "QF/console.h"
#include "QF/cvar.h"
#include "QF/dstring.h"
#include "QF/model.h"
#include "QF/msg.h"
#include "QF/plugin.h"
@ -244,19 +245,25 @@ SV_Shutdown (void)
void
SV_Error (const char *error, va_list argptr)
{
static char string[1024];
dstring_t *string;
static qboolean inerror = false;
if (inerror)
return;
string = dstring_new ();
inerror = true;
vsnprintf (string, sizeof (string), error, argptr);
dvsprintf (string, error, argptr);
dstring_insertstr (string, "server crashed: ", 0);
dstring_appendstr (string, "\n");
SV_FinalMessage (string->str);
SV_FinalMessage (va ("server crashed: %s\n", string));
Sys_Print (stderr, error, argptr);
if (con_module)
con_module->functions->console->pC_Print (error, argptr);
else
Sys_Print (stderr, error, argptr);
}
/*

View file

@ -179,7 +179,7 @@ SV_LoadProgs (void)
PR_LoadProgs (&sv_pr_state, sv_progs->string, MAX_EDICTS, 0);
if (!sv_pr_state.progs)
Sys_Error ("SV_LoadProgs: couldn't load %s", sv_progs->string);
Sys_Error ("SV_LoadProgs: couldn't load %s\n", sv_progs->string);
// progs engine needs these globals anyway
sv_globals.self = sv_pr_state.globals.self;
sv_globals.time = sv_pr_state.globals.time;