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

This commit is contained in:
AzaezelX 2021-09-27 20:04:58 -05:00
parent ef652ad8b9
commit 44b81ace69

View file

@ -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(getStrikeSound() && !getStrikeSoundProfile())
if (!getThunderSoundProfile(j))
Con::errorf(ConsoleLogEntry::General, "LightningData::preload: Cant get an sfxProfile for thunder.");
}
if(!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;