瀏覽代碼

Fixes logic check for sound asset macros so if the defined field value is an object, we consider it valid, as it's almost certainly an SFXPlaylist or track. This removes some unneeded error spam

JeffR 3 年之前
父節點
當前提交
448a453e51
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      Engine/source/T3D/assets/SoundAsset.h

+ 2 - 2
Engine/source/T3D/assets/SoundAsset.h

@@ -253,7 +253,7 @@ public: \
          Con::errorf("%s(%s)::_set%s() - sound asset failure\"%s\" due to [%s]", macroText(className), getName(), macroText(name), _in, SoundAsset::getAssetErrstrn(m##name##Asset->getStatus()).c_str());\
          return false; \
       }\
-      else if (!m##name)\
+      else if (!m##name && (m##name##Name != StringTable->EmptyString() && !Sim::findObject(m##name##Name)))\
       {\
          Con::errorf("%s(%s)::_set%s() - Couldn't load sound \"%s\"", macroText(className), getName(), macroText(name), _in);\
          return false;\
@@ -417,7 +417,7 @@ public: \
          Con::errorf("%s(%s)::_set%s(%i) - sound asset failure\"%s\" due to [%s]", macroText(className), getName(), macroText(name),index, _in, SoundAsset::getAssetErrstrn(m##name##Asset[index]->getStatus()).c_str());\
          return false; \
       }\
-      else if (!m##name[index])\
+      else if (!m##name[index] && (m##name##Name[index] != StringTable->EmptyString() && !Sim::findObject(m##name##Name[index])))\
       {\
          Con::errorf("%s(%s)::_set%s(%i) - Couldn't load sound \"%s\"", macroText(className), getName(), macroText(name),index, _in);\
          return false;\