Browse Source

Merge pull request #764 from Azaezel/alpha40/logNo_foundAssetcount

getAssetIdByFilename loaded state fix
Brian Roberts 3 years ago
parent
commit
02864095ee
2 changed files with 10 additions and 0 deletions
  1. 5 0
      Engine/source/T3D/assets/ImageAsset.cpp
  2. 5 0
      Engine/source/T3D/assets/ShapeAsset.cpp

+ 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;
 }