mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 11:29:54 +00:00
Don't add auto started local Lua scripts twice
This commit is contained in:
parent
b29949d5a7
commit
f92b5040c6
1 changed files with 4 additions and 1 deletions
|
@ -92,13 +92,16 @@ namespace LuaUtil
|
|||
if (hasScript(scriptId))
|
||||
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);
|
||||
std::string debugName = mNamePrefix;
|
||||
debugName.push_back('[');
|
||||
debugName.append(path);
|
||||
debugName.push_back(']');
|
||||
|
||||
LoadedData& data = ensureLoaded();
|
||||
Script& script = data.mScripts[scriptId];
|
||||
script.mHiddenData = view.newTable();
|
||||
script.mHiddenData[sScriptIdKey] = ScriptId{ this, scriptId };
|
||||
|
|
Loading…
Reference in a new issue