mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-10 23:08:05 -05:00
Mark scriptstrings as used even when referencing them via zone pointer
This commit is contained in:
@ -50,12 +50,24 @@ void AssetLoader::LoadScriptStringArray(const bool atStreamStart, const size_t c
|
||||
}
|
||||
}
|
||||
|
||||
void AssetLoader::MarkScriptStringArrayAsUsed(const scr_string_t* scrStringArray, const size_t count)
|
||||
{
|
||||
for (size_t index = 0; index < count; index++)
|
||||
{
|
||||
const auto scrString = scrStringArray[index];
|
||||
if (scrString >= m_zone->m_script_strings.Count())
|
||||
continue;
|
||||
|
||||
m_used_script_strings.emplace(scrString);
|
||||
}
|
||||
}
|
||||
|
||||
XAssetInfoGeneric* AssetLoader::LinkAsset(std::string name, void* asset)
|
||||
{
|
||||
std::vector<scr_string_t> usedScriptStrings;
|
||||
if(!m_used_script_strings.empty())
|
||||
if (!m_used_script_strings.empty())
|
||||
{
|
||||
for(auto scrString : m_used_script_strings)
|
||||
for (auto scrString : m_used_script_strings)
|
||||
{
|
||||
usedScriptStrings.push_back(scrString);
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ protected:
|
||||
|
||||
scr_string_t UseScriptString(scr_string_t scrString);
|
||||
void LoadScriptStringArray(bool atStreamStart, size_t count);
|
||||
void MarkScriptStringArrayAsUsed(const scr_string_t* scrStringArray, size_t count);
|
||||
|
||||
XAssetInfoGeneric* LinkAsset(std::string name, void* asset);
|
||||
|
||||
|
Reference in New Issue
Block a user