Renamed local variable so it doesn't interfere with the provided argument.

String errorStr should be filled in only when ::preload returns false.
This commit is contained in:
bank 2014-05-06 15:35:46 +04:00
parent b0fcc91058
commit a7756b5591
5 changed files with 19 additions and 19 deletions

View file

@ -736,9 +736,9 @@ bool ExplosionData::preload(bool server, String &errorStr)
if( !server )
{
String errorStr;
if( !sfxResolve( &soundProfile, errorStr ) )
Con::errorf(ConsoleLogEntry::General, "Error, unable to load sound profile for explosion datablock: %s", errorStr.c_str());
String sfxErrorStr;
if( !sfxResolve( &soundProfile, sfxErrorStr ) )
Con::errorf(ConsoleLogEntry::General, "Error, unable to load sound profile for explosion datablock: %s", sfxErrorStr.c_str());
if (!particleEmitter && particleEmitterId != 0)
if (Sim::findObject(particleEmitterId, particleEmitter) == false)
Con::errorf(ConsoleLogEntry::General, "Error, unable to load particle emitter for explosion datablock");

View file

@ -287,14 +287,14 @@ bool LightningData::preload(bool server, String &errorStr)
if (server == false)
{
String errorStr;
String sfxErrorStr;
for (U32 i = 0; i < MaxThunders; i++) {
if( !sfxResolve( &thunderSounds[ i ], errorStr ) )
Con::errorf(ConsoleLogEntry::General, "LightningData::preload: Invalid packet: %s", errorStr.c_str());
if( !sfxResolve( &thunderSounds[ i ], sfxErrorStr ) )
Con::errorf(ConsoleLogEntry::General, "LightningData::preload: Invalid packet: %s", sfxErrorStr.c_str());
}
if( !sfxResolve( &strikeSound, errorStr ) )
Con::errorf(ConsoleLogEntry::General, "LightningData::preload: Invalid packet: %s", errorStr.c_str());
if( !sfxResolve( &strikeSound, sfxErrorStr ) )
Con::errorf(ConsoleLogEntry::General, "LightningData::preload: Invalid packet: %s", sfxErrorStr.c_str());
for (U32 i = 0; i < MaxTextures; i++)
{

View file

@ -427,9 +427,9 @@ bool PlayerData::preload(bool server, String &errorStr)
{
for( U32 i = 0; i < MaxSounds; ++ i )
{
String errorStr;
if( !sfxResolve( &sound[ i ], errorStr ) )
Con::errorf( "PlayerData::preload: %s", errorStr.c_str() );
String sfxErrorStr;
if( !sfxResolve( &sound[ i ], sfxErrorStr ) )
Con::errorf( "PlayerData::preload: %s", sfxErrorStr.c_str() );
}
}

View file

@ -320,9 +320,9 @@ bool ProjectileData::preload(bool server, String &errorStr)
if (Sim::findObject(decalId, decal) == false)
Con::errorf(ConsoleLogEntry::General, "ProjectileData::preload: Invalid packet, bad datablockId(decal): %d", decalId);
String errorStr;
if( !sfxResolve( &sound, errorStr ) )
Con::errorf(ConsoleLogEntry::General, "ProjectileData::preload: Invalid packet: %s", errorStr.c_str());
String sfxErrorStr;
if( !sfxResolve( &sound, sfxErrorStr ) )
Con::errorf(ConsoleLogEntry::General, "ProjectileData::preload: Invalid packet: %s", sfxErrorStr.c_str());
if (!lightDesc && lightDescId != 0)
if (Sim::findObject(lightDescId, lightDesc) == false)

View file

@ -136,11 +136,11 @@ bool ProximityMineData::preload( bool server, String& errorStr )
if ( !server )
{
// Resolve sounds
String errorStr;
if( !sfxResolve( &armingSound, errorStr ) )
Con::errorf( ConsoleLogEntry::General, "ProximityMineData::preload: Invalid packet: %s", errorStr.c_str() );
if( !sfxResolve( &triggerSound, errorStr ) )
Con::errorf( ConsoleLogEntry::General, "ProximityMineData::preload: Invalid packet: %s", errorStr.c_str() );
String sfxErrorStr;
if( !sfxResolve( &armingSound, sfxErrorStr ) )
Con::errorf( ConsoleLogEntry::General, "ProximityMineData::preload: Invalid packet: %s", sfxErrorStr.c_str() );
if( !sfxResolve( &triggerSound, sfxErrorStr ) )
Con::errorf( ConsoleLogEntry::General, "ProximityMineData::preload: Invalid packet: %s", sfxErrorStr.c_str() );
}
if ( mShape )