From ff4c152f2349ae590d8fe7001813fc7aacd7469a Mon Sep 17 00:00:00 2001 From: LJW-Dev Date: Sat, 1 Nov 2025 17:27:32 +0800 Subject: [PATCH] Assets with a name starting with ',' will now be always loaded as a default dependency. --- src/ObjLoading/Asset/AssetCreationContext.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ObjLoading/Asset/AssetCreationContext.cpp b/src/ObjLoading/Asset/AssetCreationContext.cpp index fb797d42..7ff9b3bb 100644 --- a/src/ObjLoading/Asset/AssetCreationContext.cpp +++ b/src/ObjLoading/Asset/AssetCreationContext.cpp @@ -155,6 +155,9 @@ XAssetInfoGeneric* AssetCreationContext::LoadDependencyGeneric(const asset_type_ return LoadDefaultAssetDependency(assetType, std::format(",{}", assetName)); } + if (assetName.starts_with(',')) + return LoadDefaultAssetDependency(assetType, assetName); + const auto assetTypeName = m_game.GetAssetTypeName(assetType).value_or("unknown"); if (m_ignored_asset_lookup->IsAssetIgnored(assetType, assetName)) @@ -172,10 +175,6 @@ XAssetInfoGeneric* AssetCreationContext::LoadDependencyGeneric(const asset_type_ con::error(R"(Could not load asset "{}" of type "{}")", assetName, assetTypeName); } - else if (assetName[0] == ',') - { - return LoadDefaultAssetDependency(assetType, assetName); - } else if (required) { con::error(R"(Missing asset "{}" of type "{}")", assetName, assetTypeName);