Browse Source

don't check a profile if we don't have a sound asset

AzaezelX 4 years ago
parent
commit
44b81ace69
1 changed files with 5 additions and 7 deletions
  1. 5 7
      Engine/source/T3D/fx/lightning.cpp

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

@@ -294,19 +294,17 @@ bool LightningData::preload(bool server, String &errorStr)
    
    
    if (server == false) 
    if (server == false) 
    {
    {
-      for (S32 i = 0; i < MaxThunders; i++) {
+      for (S32 i = 0; i < MaxThunders; i++)
+      {
          if (getThunderSound(i))
          if (getThunderSound(i))
          {
          {
             _setThunderSound(getThunderSound(i), i);
             _setThunderSound(getThunderSound(i), i);
+            if (!getThunderSoundProfile(i))
+               Con::errorf(ConsoleLogEntry::General, "LightningData::preload: Cant get an sfxProfile for thunder.");
          }
          }
       }
       }
 
 
-      for (U32 j = 0; j < MaxThunders; j++) {
-         if (!getThunderSoundProfile(j))
-            Con::errorf(ConsoleLogEntry::General, "LightningData::preload: Cant get an sfxProfile for thunder.");
-      }
-
-      if(!getStrikeSoundProfile())
+      if(getStrikeSound() && !getStrikeSoundProfile())
          Con::errorf(ConsoleLogEntry::General, "LightningData::preload: can't get sfxProfile from asset");
          Con::errorf(ConsoleLogEntry::General, "LightningData::preload: can't get sfxProfile from asset");
 
 
       mNumStrikeTextures = 0;
       mNumStrikeTextures = 0;