Skip to content

Commit 690f95f

Browse files
committed
Merge branch 'autostartmenot' into 'master'
Don't add auto started local Lua scripts twice Closes #8268 See merge request OpenMW/openmw!4497
2 parents 6ac0880 + f92b504 commit 690f95f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

components/lua/scriptscontainer.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,16 @@ namespace LuaUtil
9292
if (hasScript(scriptId))
9393
return false; // already present
9494

95+
LoadedData& data = ensureLoaded();
96+
if (data.mScripts.count(scriptId) != 0)
97+
return false; // bail if the script we're adding was auto started
98+
9599
const VFS::Path::Normalized& path = scriptPath(scriptId);
96100
std::string debugName = mNamePrefix;
97101
debugName.push_back('[');
98102
debugName.append(path);
99103
debugName.push_back(']');
100104

101-
LoadedData& data = ensureLoaded();
102105
Script& script = data.mScripts[scriptId];
103106
script.mHiddenData = view.newTable();
104107
script.mHiddenData[sScriptIdKey] = ScriptId{ this, scriptId };

0 commit comments

Comments
 (0)