mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-29 04:20:29 +00:00
Don't add auto started local Lua scripts twice
This commit is contained in:
parent
b29949d5a7
commit
f92b5040c6
@ -92,13 +92,16 @@ namespace LuaUtil
|
|||||||
if (hasScript(scriptId))
|
if (hasScript(scriptId))
|
||||||
return false; // already present
|
return false; // already present
|
||||||
|
|
||||||
|
LoadedData& data = ensureLoaded();
|
||||||
|
if (data.mScripts.count(scriptId) != 0)
|
||||||
|
return false; // bail if the script we're adding was auto started
|
||||||
|
|
||||||
const VFS::Path::Normalized& path = scriptPath(scriptId);
|
const VFS::Path::Normalized& path = scriptPath(scriptId);
|
||||||
std::string debugName = mNamePrefix;
|
std::string debugName = mNamePrefix;
|
||||||
debugName.push_back('[');
|
debugName.push_back('[');
|
||||||
debugName.append(path);
|
debugName.append(path);
|
||||||
debugName.push_back(']');
|
debugName.push_back(']');
|
||||||
|
|
||||||
LoadedData& data = ensureLoaded();
|
|
||||||
Script& script = data.mScripts[scriptId];
|
Script& script = data.mScripts[scriptId];
|
||||||
script.mHiddenData = view.newTable();
|
script.mHiddenData = view.newTable();
|
||||||
script.mHiddenData[sScriptIdKey] = ScriptId{ this, scriptId };
|
script.mHiddenData[sScriptIdKey] = ScriptId{ this, scriptId };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user