Permalink
Browse files

Fix 'missing' model warnings in debug build

  • Loading branch information...
jaytersen committed Apr 2, 2016
1 parent 62a64e4 commit 433996cf50d7a0626dd78c6dc27b4b8814d57a18
Showing with 35 additions and 9 deletions.
  1. +1 −0 src/cgame/cg_buildable.cpp
  2. +8 −2 src/cgame/cg_players.cpp
  3. +26 −7 src/cgame/cg_weapons.cpp
@@ -630,6 +630,7 @@ void CG_InitBuildables()
//Prefer md5 models over md3
if ( cg_highPolyBuildableModels.integer &&
CG_FileExists( va( "models/buildables/%s/%s.iqm", buildableName, buildableName ) ) &&
( bi->models[ 0 ] = trap_R_RegisterModel( va( "models/buildables/%s/%s.iqm",
buildableName, buildableName ) ) ) )
{
View
@@ -893,11 +893,17 @@ static bool CG_RegisterClientModelname( clientInfo_t *ci, const char *modelName,
{
Com_sprintf( filename, sizeof( filename ), "models/players/%s/%s.iqm",
modelName, modelName );
ci->bodyModel = trap_R_RegisterModel( filename );
if ( CG_FileExists( filename ) )
{
ci->bodyModel = trap_R_RegisterModel( filename );
}
if ( ! ci->bodyModel ) {
Com_sprintf( filename, sizeof( filename ), "models/players/%s/body.md5mesh", modelName );
ci->bodyModel = trap_R_RegisterModel( filename );
if ( CG_FileExists(filename) )
{
ci->bodyModel = trap_R_RegisterModel( filename );
}
}
else
{
View
@@ -726,7 +726,9 @@ static bool CG_ParseWeaponFile( const char *filename, int weapon, weaponInfo_t *
COM_StripExtension( token, token2 );
if ( cg_highPolyWeaponModels.integer && ( wi->weaponModel = trap_R_RegisterModel( va( "%s_view.iqm", token2 ) ) ) )
if ( cg_highPolyWeaponModels.integer &&
CG_FileExists( va( "%s_view.iqm", token2 ) ) &&
( wi->weaponModel = trap_R_RegisterModel( va( "%s_view.iqm", token2 ) ) ) )
{
wi->md5 = true;
@@ -816,7 +818,9 @@ static bool CG_ParseWeaponFile( const char *filename, int weapon, weaponInfo_t *
va( "%s_view.iqm:fire7", token2 ), false, false, false );
}
}
else if ( cg_highPolyWeaponModels.integer && ( wi->weaponModel = trap_R_RegisterModel( va( "%s_view.md5mesh", token2 ) ) ) )
else if ( cg_highPolyWeaponModels.integer &&
CG_FileExists( va( "%s_view.md5mesh", token2 ) ) &&
( wi->weaponModel = trap_R_RegisterModel( va( "%s_view.md5mesh", token2 ) ) ) )
{
wi->md5 = true;
@@ -918,15 +922,24 @@ static bool CG_ParseWeaponFile( const char *filename, int weapon, weaponInfo_t *
COM_StripExtension( token, path );
strcat( path, "_flash.md3" );
wi->flashModel = trap_R_RegisterModel( path );
if ( CG_FileExists( path ) )
{
wi->flashModel = trap_R_RegisterModel( path );
}
COM_StripExtension( token, path );
strcat( path, "_barrel.md3" );
wi->barrelModel = trap_R_RegisterModel( path );
if ( CG_FileExists( path ) )
{
wi->barrelModel = trap_R_RegisterModel( path );
}
COM_StripExtension( token, path );
strcat( path, "_hand.md3" );
wi->handsModel = trap_R_RegisterModel( path );
if ( CG_FileExists( path ) )
{
wi->handsModel = trap_R_RegisterModel( path );
}
continue;
}
@@ -951,11 +964,17 @@ static bool CG_ParseWeaponFile( const char *filename, int weapon, weaponInfo_t *
COM_StripExtension( token, path );
strcat( path, "_flash.md3" );
wi->flashModel3rdPerson = trap_R_RegisterModel( path );
if ( CG_FileExists( path ) )
{
wi->flashModel3rdPerson = trap_R_RegisterModel( path );
}
COM_StripExtension( token, path );
strcat( path, "_barrel.md3" );
wi->barrelModel3rdPerson = trap_R_RegisterModel( path );
if ( CG_FileExists( path ) )
{
wi->barrelModel3rdPerson = trap_R_RegisterModel( path );
}
continue;
}

0 comments on commit 433996c

Please sign in to comment.