diff --git a/src/ZoneCodeGeneratorLib/Parsing/PostProcessing/MarkingRequiredPostProcessor.cpp b/src/ZoneCodeGeneratorLib/Parsing/PostProcessing/MarkingRequiredPostProcessor.cpp index 17b425585..439b41ff7 100644 --- a/src/ZoneCodeGeneratorLib/Parsing/PostProcessing/MarkingRequiredPostProcessor.cpp +++ b/src/ZoneCodeGeneratorLib/Parsing/PostProcessing/MarkingRequiredPostProcessor.cpp @@ -6,7 +6,7 @@ #include -bool MarkingRequiredPostProcessor::RequiresMarking(std::unordered_set& visitedStructures, const StructureInformation* info) +bool MarkingRequiredPostProcessor::CalculateRequiresMarking(std::unordered_set& visitedStructures, StructureInformation* info) { if (visitedStructures.find(info) != visitedStructures.end()) return info->m_requires_marking; @@ -14,7 +14,10 @@ bool MarkingRequiredPostProcessor::RequiresMarking(std::unordered_setm_asset_enum_entry) + { + info->m_requires_marking = true; return true; + } for (const auto& member : info->m_ordered_members) { @@ -43,12 +46,19 @@ bool MarkingRequiredPostProcessor::RequiresMarking(std::unordered_setm_is_script_string || member->m_type && member->m_type->m_asset_enum_entry) + { + info->m_requires_marking = true; return true; + } - if (member->m_type != nullptr && member->m_type != info && RequiresMarking(visitedStructures, member->m_type)) + if (member->m_type != nullptr && member->m_type != info && CalculateRequiresMarking(visitedStructures, member->m_type)) + { + info->m_requires_marking = true; return true; + } } + info->m_requires_marking = false; return false; } @@ -59,7 +69,7 @@ bool MarkingRequiredPostProcessor::PostProcess(IDataRepository* repository) std::unordered_set visitedStructures; for (const auto& info : allInfos) { - info->m_requires_marking = RequiresMarking(visitedStructures, info); + CalculateRequiresMarking(visitedStructures, info); } return true; diff --git a/src/ZoneCodeGeneratorLib/Parsing/PostProcessing/MarkingRequiredPostProcessor.h b/src/ZoneCodeGeneratorLib/Parsing/PostProcessing/MarkingRequiredPostProcessor.h index 5d486c719..ad7f81652 100644 --- a/src/ZoneCodeGeneratorLib/Parsing/PostProcessing/MarkingRequiredPostProcessor.h +++ b/src/ZoneCodeGeneratorLib/Parsing/PostProcessing/MarkingRequiredPostProcessor.h @@ -6,7 +6,7 @@ class MarkingRequiredPostProcessor final : public IPostProcessor { - static bool RequiresMarking(std::unordered_set& visitedStructures, const StructureInformation* info); + static bool CalculateRequiresMarking(std::unordered_set& visitedStructures, StructureInformation* info); public: bool PostProcess(IDataRepository* repository) override; diff --git a/src/ZoneLoading/Loading/AssetMarker.cpp b/src/ZoneLoading/Loading/AssetMarker.cpp index 8b20c5866..ecf14dd9e 100644 --- a/src/ZoneLoading/Loading/AssetMarker.cpp +++ b/src/ZoneLoading/Loading/AssetMarker.cpp @@ -47,7 +47,7 @@ XAssetInfoGeneric* AssetMarker::GetAssetInfoByName(std::string name) const std::vector AssetMarker::GetDependencies() const { std::vector dependencies; - if (!m_used_script_strings.empty()) + if (!m_dependencies.empty()) { dependencies.reserve(m_dependencies.size()); for (auto dependency : m_dependencies)