diff --git a/code/game/g_local.h b/code/game/g_local.h index 74aaddf6..12858c28 100644 --- a/code/game/g_local.h +++ b/code/game/g_local.h @@ -627,7 +627,7 @@ void AddTournamentQueue(gclient_t *client); void QDECL G_LogPrintf( const char *fmt, ... ) __attribute__ ((format (printf, 1, 2))); void SendScoreboardMessageToAllClients( void ); void QDECL G_Printf( const char *fmt, ... ) __attribute__ ((format (printf, 1, 2))); -void QDECL G_Error( const char *fmt, ... ) __attribute__ ((format (printf, 1, 2))); +void QDECL G_Error( const char *fmt, ... ) __attribute__ ((noreturn, format (printf, 1, 2))); // // g_client.c @@ -767,7 +767,7 @@ extern vmCvar_t g_singlePlayer; extern vmCvar_t g_proxMineTimeout; void trap_Printf( const char *fmt ); -void trap_Error( const char *fmt ); +void trap_Error(const char *fmt) __attribute__((noreturn)); int trap_Milliseconds( void ); int trap_RealTime( qtime_t *qtime ); int trap_Argc( void ); diff --git a/code/game/g_syscalls.c b/code/game/g_syscalls.c index 1868d0ac..8d385a22 100644 --- a/code/game/g_syscalls.c +++ b/code/game/g_syscalls.c @@ -45,8 +45,10 @@ void trap_Printf( const char *fmt ) { syscall( G_PRINT, fmt ); } -void trap_Error( const char *fmt ) { - syscall( G_ERROR, fmt ); +void trap_Error(const char *fmt) +{ + syscall(G_ERROR, fmt); + exit(1); } int trap_Milliseconds( void ) { diff --git a/code/ui/ui_local.h b/code/ui/ui_local.h index fc6e9af3..10484fe8 100644 --- a/code/ui/ui_local.h +++ b/code/ui/ui_local.h @@ -915,7 +915,7 @@ void UI_SPSkillMenu_Cache( void ); // ui_syscalls.c // void trap_Print( const char *string ); -void trap_Error( const char *string ); +void trap_Error(const char *string) __attribute__((noreturn)); int trap_Milliseconds( void ); void trap_Cvar_Register( vmCvar_t *vmCvar, const char *varName, const char *defaultValue, int flags ); void trap_Cvar_Update( vmCvar_t *vmCvar ); diff --git a/code/ui/ui_syscalls.c b/code/ui/ui_syscalls.c index 5b3ab45f..d1488ced 100644 --- a/code/ui/ui_syscalls.c +++ b/code/ui/ui_syscalls.c @@ -44,8 +44,10 @@ void trap_Print( const char *string ) { syscall( UI_PRINT, string ); } -void trap_Error( const char *string ) { - syscall( UI_ERROR, string ); +void trap_Error(const char *string) +{ + syscall(UI_ERROR, string); + exit(1); } int trap_Milliseconds( void ) {