From 20b6c68b9511adddf32030f5785eb2667a7f0e8c Mon Sep 17 00:00:00 2001 From: Ben Millwood Date: Wed, 14 Oct 2009 22:50:05 +0000 Subject: * Report source file in some error messages --- src/game/g_combat.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/game/g_combat.c b/src/game/g_combat.c index fb9d5942..2dca0736 100644 --- a/src/game/g_combat.c +++ b/src/game/g_combat.c @@ -411,7 +411,7 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int G_ParseDmgScript =============== */ -int G_ParseDmgScript( damageRegion_t *regions, char *buf ) +static int G_ParseDmgScript( damageRegion_t *regions, char *buf ) { char *token; float angleSpan, heightSpan; @@ -425,13 +425,13 @@ int G_ParseDmgScript( damageRegion_t *regions, char *buf ) if( strcmp( token, "{" ) ) { - G_Printf( "Missing { in damage region file\n" ); + COM_ParseError( "Missing {" ); break; } if( count >= MAX_DAMAGE_REGIONS ) { - G_Printf( "Max damage regions exceeded in damage region file\n" ); + COM_ParseError( "Max damage regions exceeded" ); break; } @@ -450,7 +450,7 @@ int G_ParseDmgScript( damageRegion_t *regions, char *buf ) if( !token[ 0 ] ) { - G_Printf( "Unexpected end of damage region file\n" ); + COM_ParseError( "Unexpected end of file" ); break; } @@ -506,7 +506,7 @@ int G_ParseDmgScript( damageRegion_t *regions, char *buf ) } else { - G_Printf("WARNING: unknown token \"%s\" in damage script\n", token); + COM_ParseWarning("Unknown token \"%s\"", token); } } @@ -818,6 +818,8 @@ void G_InitDamageLocations( void ) continue; } + COM_BeginParseSession( filename ); + trap_FS_Read( buffer, len, fileHandle ); buffer[len] = 0; trap_FS_FCloseFile( fileHandle ); @@ -844,6 +846,8 @@ void G_InitDamageLocations( void ) continue; } + COM_BeginParseSession( filename ); + trap_FS_Read( buffer, len, fileHandle ); buffer[len] = 0; trap_FS_FCloseFile( fileHandle ); -- cgit