From 3be502630c9bb66c85efd715ec44bc3e76160ce9 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 28 Aug 2002 21:12:22 +0000 Subject: [PATCH] don't call SV_FinalMessage in SV_Error until networking has been initialized so bogus error messages don't get printed --- qw/source/sv_main.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/qw/source/sv_main.c b/qw/source/sv_main.c index d1dca3010..ec5c5374b 100644 --- a/qw/source/sv_main.c +++ b/qw/source/sv_main.c @@ -187,6 +187,8 @@ cvar_t *pr_gc; cvar_t *pr_gc_interval; int pr_gc_count = 0; +int sv_net_initialized; + void SV_AcceptClient (netadr_t adr, int userid, char *userinfo); void Master_Shutdown (void); @@ -241,20 +243,22 @@ SV_Shutdown (void) void SV_Error (const char *error, va_list argptr) { - dstring_t *string; static qboolean inerror = false; if (inerror) return; - string = dstring_new (); - inerror = true; - dvsprintf (string, error, argptr); - dstring_insertstr (string, 0, "server crashed: "); - dstring_appendstr (string, "\n"); - SV_FinalMessage (string->str); + if (sv_net_initialized) { + dstring_t *string = dstring_new (); + + dvsprintf (string, error, argptr); + dstring_insertstr (string, 0, "server crashed: "); + dstring_appendstr (string, "\n"); + SV_FinalMessage (string->str); + dstring_delete (string); + } if (con_module) { con_module->functions->console->pC_Print (error, argptr); @@ -2361,6 +2365,7 @@ SV_InitNet (void) // heartbeats will always be sent to the id master svs.last_heartbeat = -99999; // send immediately // NET_StringToAdr ("192.246.40.70:27000", &idmaster_adr); + sv_net_initialized = 1; } void