From 44b81ace69b3141d1c4a5f8c261d55a7cf2307b9 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 27 Sep 2021 20:04:58 -0500 Subject: [PATCH] don't check a profile if we don't have a sound asset --- Engine/source/T3D/fx/lightning.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Engine/source/T3D/fx/lightning.cpp b/Engine/source/T3D/fx/lightning.cpp index 2f16f4cc0..8f1ba8bf6 100644 --- a/Engine/source/T3D/fx/lightning.cpp +++ b/Engine/source/T3D/fx/lightning.cpp @@ -294,19 +294,17 @@ bool LightningData::preload(bool server, String &errorStr) if (server == false) { - for (S32 i = 0; i < MaxThunders; i++) { + for (S32 i = 0; i < MaxThunders; i++) + { if (getThunderSound(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"); mNumStrikeTextures = 0;