mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-22 11:18:22 -05:00
Enable the global Lua state when loading scheduled scripts from file
This commit is contained in:
@@ -63,10 +63,10 @@ ScheduledScript::ScheduledScript(const ghoul::Dictionary& dict)
|
||||
}
|
||||
}
|
||||
|
||||
void ScriptScheduler::loadScripts(const std::string& filepath) {
|
||||
void ScriptScheduler::loadScripts(const std::string& filepath, lua_State* L) {
|
||||
ghoul::Dictionary timedScriptsDict;
|
||||
try {
|
||||
ghoul::lua::loadDictionaryFromFile(absPath(filepath), timedScriptsDict);
|
||||
ghoul::lua::loadDictionaryFromFile(absPath(filepath), timedScriptsDict, L);
|
||||
}
|
||||
catch (const ghoul::RuntimeError& e) {
|
||||
LERROR(e.what());
|
||||
@@ -145,7 +145,7 @@ namespace luascriptfunctions {
|
||||
return luaL_error(L, "filepath string is empty");
|
||||
}
|
||||
|
||||
OsEng.scriptScheduler().loadScripts(missionFileName);
|
||||
OsEng.scriptScheduler().loadScripts(missionFileName, L);
|
||||
}
|
||||
|
||||
int skipTo(lua_State* L) {
|
||||
|
||||
Reference in New Issue
Block a user