mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-01-25 09:23:03 +00:00
chore: adjust asset data when taking from global asset pools
This commit is contained in:
@@ -10,7 +10,7 @@ class AssetVisitor
|
||||
public:
|
||||
virtual ~AssetVisitor() = default;
|
||||
|
||||
virtual std::optional<XAssetInfoGeneric> Visit_Dependency(asset_type_t assetType, const char* assetName)
|
||||
virtual std::optional<XAssetInfoGeneric*> Visit_Dependency(asset_type_t assetType, const char* assetName)
|
||||
{
|
||||
// Do nothing by default
|
||||
return std::nullopt;
|
||||
|
||||
@@ -25,6 +25,9 @@ void BaseAssetMarker::MarkArray_ScriptString(scr_string_t* scriptStringArray, co
|
||||
|
||||
void BaseAssetMarker::Mark_IndirectAssetRef(const asset_type_t assetType, const char* assetName) const
|
||||
{
|
||||
if (!assetName)
|
||||
return;
|
||||
|
||||
m_visitor.Visit_IndirectAssetRef(assetType, assetName);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ protected:
|
||||
|
||||
const auto result = m_visitor.Visit_Dependency(AssetType::EnumEntry, AssetName<AssetType>(*asset));
|
||||
if (result.has_value())
|
||||
asset = static_cast<std::add_pointer_t<typename AssetType::Type>>(result->m_ptr);
|
||||
asset = static_cast<std::add_pointer_t<typename AssetType::Type>>((*result)->m_ptr);
|
||||
}
|
||||
|
||||
void Mark_ScriptString(scr_string_t& scriptString) const;
|
||||
|
||||
Reference in New Issue
Block a user