瀏覽代碼

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

String errorStr should be filled in only when ::preload returns false.
bank 11 年之前
父節點
當前提交
a7756b5591

+ 3 - 3
Engine/source/T3D/fx/explosion.cpp

@@ -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");

+ 5 - 5
Engine/source/T3D/fx/lightning.cpp

@@ -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++) 
       {

+ 3 - 3
Engine/source/T3D/player.cpp

@@ -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() );
       }
    }
 

+ 3 - 3
Engine/source/T3D/projectile.cpp

@@ -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)

+ 5 - 5
Engine/source/T3D/proximityMine.cpp

@@ -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 )