Browse Source

Merge pull request #20 from x6herbius/improve-logging

Made various log messages more informative
pull/2/head
mittorn 6 years ago committed by GitHub
parent
commit
7b36796f41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      engine/client/cl_game.c
  2. 2
      engine/client/cl_gameui.c
  3. 2
      engine/client/cl_main.c
  4. 4
      engine/client/s_vox.c
  5. 2
      engine/common/mod_bmodel.c
  6. 8
      engine/common/model.c
  7. 8
      engine/server/sv_game.c
  8. 2
      engine/server/sv_save.c

4
engine/client/cl_game.c

@ -1215,7 +1215,7 @@ static qboolean CL_LoadHudSprite( const char *szSpriteName, model_t *m_pSprite,
} }
else else
{ {
Con_Reportf( S_ERROR "%s couldn't load\n", szSpriteName ); Con_Reportf( S_ERROR "Could not load HUD sprite %s\n", szSpriteName );
Mod_UnloadSpriteModel( m_pSprite ); Mod_UnloadSpriteModel( m_pSprite );
return false; return false;
} }
@ -2341,7 +2341,7 @@ int CL_FindModelIndex( const char *m )
if( lasttimewarn < host.realtime ) if( lasttimewarn < host.realtime )
{ {
// tell user about problem (but don't spam console) // tell user about problem (but don't spam console)
Con_Printf( S_ERROR "%s not precached\n", filepath ); Con_Printf( S_ERROR "Could not find index for model %s: not precached\n", filepath );
lasttimewarn = host.realtime + 1.0f; lasttimewarn = host.realtime + 1.0f;
} }

2
engine/client/cl_gameui.c

@ -382,7 +382,7 @@ static HIMAGE pfnPIC_Load( const char *szPicName, const byte *image_buf, int ima
if( !szPicName || !*szPicName ) if( !szPicName || !*szPicName )
{ {
Con_Reportf( S_ERROR "CL_LoadImage: bad name!\n" ); Con_Reportf( S_ERROR "CL_LoadImage: refusing to load image with empty name\n" );
return 0; return 0;
} }

2
engine/client/cl_main.c

@ -2509,7 +2509,7 @@ qboolean CL_PrecacheResources( void )
{ {
if( FBitSet( pRes->ucFlags, RES_WASMISSING )) if( FBitSet( pRes->ucFlags, RES_WASMISSING ))
{ {
Con_Printf( S_ERROR "%s%s couldn't load\n", DEFAULT_SOUNDPATH, pRes->szFileName ); Con_Printf( S_ERROR "Could not load sound %s%s\n", DEFAULT_SOUNDPATH, pRes->szFileName );
cl.sound_precache[pRes->nIndex][0] = 0; cl.sound_precache[pRes->nIndex][0] = 0;
cl.sound_index[pRes->nIndex] = 0; cl.sound_index[pRes->nIndex] = 0;
} }

4
engine/client/s_vox.c

@ -545,7 +545,7 @@ void VOX_ParseLineCommands( char *pSentenceData, int sentenceIndex )
length = pNext - pSentenceData; length = pNext - pSentenceData;
if( tempBufferPos + length > sizeof( tempBuffer )) if( tempBufferPos + length > sizeof( tempBuffer ))
{ {
Con_Printf( S_ERROR "sentence too long!\n" ); Con_Printf( S_ERROR "Sentence too long (max length %d characters)\n", sizeof(tempBuffer) - 1 );
return; return;
} }
@ -619,7 +619,7 @@ void VOX_ReadSentenceFile( const char *psentenceFileName )
{ {
if( g_numSentences >= MAX_SENTENCES ) if( g_numSentences >= MAX_SENTENCES )
{ {
Con_Printf( S_ERROR "VOX_Init: too many sentences specified\n" ); Con_Printf( S_ERROR "VOX_Init: too many sentences specified, max is %d\n", MAX_SENTENCES );
break; break;
} }

2
engine/common/mod_bmodel.c

@ -309,7 +309,7 @@ static void Mod_LoadLump( const byte *in, mlumpinfo_t *info, mlumpstat_t *stat,
if( l->filelen % real_entrysize ) if( l->filelen % real_entrysize )
{ {
if( !FBitSet( flags, LUMP_SILENT )) if( !FBitSet( flags, LUMP_SILENT ))
Con_DPrintf( S_ERROR "Mod_Load%s: funny lump size\n", msg2 ); Con_DPrintf( S_ERROR "Mod_Load%s: Lump size %d was not a multiple of %u bytes\n", msg2, l->filelen, real_entrysize );
loadstat.numerrors++; loadstat.numerrors++;
return; return;
} }

8
engine/common/model.c

@ -288,8 +288,8 @@ model_t *Mod_LoadModel( model_t *mod, qboolean crash )
{ {
memset( mod, 0, sizeof( model_t )); memset( mod, 0, sizeof( model_t ));
if( crash ) Host_Error( "%s couldn't load\n", tempname ); if( crash ) Host_Error( "Could not load model %s from disk\n", tempname );
else Con_Printf( S_ERROR "%s couldn't load\n", tempname ); else Con_Printf( S_ERROR "Could not load model %s from disk\n", tempname );
return NULL; return NULL;
} }
@ -331,8 +331,8 @@ model_t *Mod_LoadModel( model_t *mod, qboolean crash )
Mod_FreeModel( mod ); Mod_FreeModel( mod );
Mem_Free( buf ); Mem_Free( buf );
if( crash ) Host_Error( "%s couldn't load\n", tempname ); if( crash ) Host_Error( "Could not load model %s\n", tempname );
else Con_Printf( S_ERROR "%s couldn't load\n", tempname ); else Con_Printf( S_ERROR "Could not load model %s\n", tempname );
return NULL; return NULL;
} }

8
engine/server/sv_game.c

@ -1308,7 +1308,7 @@ void pfnSetModel( edict_t *e, const char *m )
if( notfound ) if( notfound )
{ {
Con_Printf( S_ERROR "no precache: %s\n", name ); Con_Printf( S_ERROR "Failed to set model %s: was not precached\n", name );
return; return;
} }
} }
@ -1316,7 +1316,7 @@ void pfnSetModel( edict_t *e, const char *m )
if( e == svgame.edicts ) if( e == svgame.edicts )
{ {
if( sv.state == ss_active ) if( sv.state == ss_active )
Con_Printf( S_ERROR "world model can't be changed\n" ); Con_Printf( S_ERROR "Failed to set model %s: world model cannot be changed\n", name );
return; return;
} }
@ -1363,7 +1363,7 @@ int pfnModelIndex( const char *m )
return i; return i;
} }
Con_Printf( S_ERROR "no precache: %s\n", name ); Con_Printf( S_ERROR "Cannot get index for model %s: not precached\n", name );
return 0; return 0;
} }
@ -4415,7 +4415,7 @@ void pfnForceUnmodified( FORCE_TYPE type, float *mins, float *maxs, const char *
if( !Q_strcmp( filename, pc->filename )) if( !Q_strcmp( filename, pc->filename ))
return; return;
} }
Con_Printf( S_ERROR "no precache: %s\n", filename ); Con_Printf( S_ERROR "Failed to enforce consistency for %s: was not precached\n", filename );
} }
} }

2
engine/server/sv_save.c

@ -842,7 +842,7 @@ static SAVERESTOREDATA *LoadSaveData( const char *level )
if(( pFile = FS_Open( name, "rb", true )) == NULL ) if(( pFile = FS_Open( name, "rb", true )) == NULL )
{ {
Con_Printf( S_ERROR "couldn't open.\n" ); Con_Printf( S_ERROR "Couldn't open save data file %s.\n", name );
return NULL; return NULL;
} }

Loading…
Cancel
Save