Explorar o código

getAssetIdByFilename loaded state fix
getAssetIdByFilename should set the <type>Asset->mLoadedState = AssetErrCode::BadFileReference; so we know we're using a fallback

AzaezelX %!s(int64=3) %!d(string=hai) anos
pai
achega
0136af477f

+ 5 - 0
Engine/source/T3D/assets/ImageAsset.cpp

@@ -219,6 +219,11 @@ StringTableEntry ImageAsset::getAssetIdByFilename(StringTableEntry fileName)
       //acquire and bind the asset, and return it out
       imageAssetId = query.mAssetList[0];
    }
+   else
+   {
+      AssetPtr<ImageAsset> imageAsset = imageAssetId;
+      imageAsset->mLoadedState = AssetErrCode::BadFileReference;
+   }
 
    return imageAssetId;
 }

+ 5 - 0
Engine/source/T3D/assets/ShapeAsset.cpp

@@ -473,6 +473,11 @@ StringTableEntry ShapeAsset::getAssetIdByFilename(StringTableEntry fileName)
       //acquire and bind the asset, and return it out
       shapeAssetId = query.mAssetList[0];
    }
+   else
+   {
+      AssetPtr<ShapeAsset> shapeAsset = shapeAssetId;
+      shapeAsset->mLoadedState = AssetErrCode::BadFileReference;
+   }
 
    return shapeAssetId;
 }