diff options
-rw-r--r-- | source/common.c | 12 | ||||
-rw-r--r-- | source/sv_game.c | 9 |
2 files changed, 15 insertions, 6 deletions
diff --git a/source/common.c b/source/common.c index d1f3109..0dc03b4 100644 --- a/source/common.c +++ b/source/common.c @@ -62,6 +62,7 @@ cvar_t *com_timedemo; cvar_t *com_date_format; cvar_t *com_time_format; cvar_t *com_debug_break; +cvar_t *com_fatal_error; fileHandle_t com_logFile; qboolean com_logNewline; @@ -373,9 +374,10 @@ void Com_Error( comErrorType_t code, const char *fmt, ... ) { Q_vsnprintf( com_errorMsg, sizeof( com_errorMsg ), fmt, argptr ); va_end( argptr ); - /* fix up drity message buffers */ - MSG_Init(); + // fix up drity message buffers + MSG_Init(); + // abort any console redirects Com_AbortRedirect(); if( code == ERR_DISCONNECT || code == ERR_SILENT ) { @@ -391,6 +393,11 @@ void Com_Error( comErrorType_t code, const char *fmt, ... ) { Sys_DebugBreak(); } + // make otherwise non-fatal errors fatal + if( com_fatal_error && com_fatal_error->integer ) { + code = ERR_FATAL; + } + if( code == ERR_DROP ) { Com_Printf( S_COLOR_RED "********************\n" "ERROR: %s\n" @@ -1304,6 +1311,7 @@ void Qcommon_Init( int argc, char **argv ) { com_time_format = Cvar_Get( "com_time_format", "%H:%M", 0 ); #endif com_debug_break = Cvar_Get( "com_debug_break", "0", 0 ); + com_fatal_error = Cvar_Get( "com_fatal_error", "0", 0 ); com_version = Cvar_Get( "version", version, CVAR_SERVERINFO|CVAR_ROM ); Cmd_AddCommand ("z_stats", Z_Stats_f); diff --git a/source/sv_game.c b/source/sv_game.c index b277040..97de657 100644 --- a/source/sv_game.c +++ b/source/sv_game.c @@ -91,8 +91,8 @@ static void PF_Unicast( edict_t *ent, qboolean reliable ) { } client = svs.udp_client_pool + clientNum; - if( client->state == cs_free ) { - Com_WPrintf( "PF_Unicast to a free client %d\n", clientNum ); + if( client->state <= cs_zombie ) { + Com_WPrintf( "PF_Unicast to a free/zombie client %d\n", clientNum ); goto clear; } @@ -240,8 +240,9 @@ static void PF_cprintf( edict_t *ent, int level, const char *fmt, ... ) { } client = svs.udp_client_pool + clientNum; - if( client->state == cs_free ) { - Com_Error( ERR_DROP, "PF_cprintf to a free client %d", clientNum ); + if( client->state <= cs_zombie ) { + Com_WPrintf( "PF_cprintf to a free/zombie client %d", clientNum ); + return; } MSG_WriteByte( svc_print ); |