fix threading issues with initialization

This commit is contained in:
Evil Factory
2022-06-17 14:29:10 -03:00
parent 349cf89eb5
commit a2f8d0019f
@@ -479,7 +479,8 @@ modding needs.
{ {
try try
{ {
lua.Call(lua.LoadFile(LuaSetupFile), Path.GetDirectoryName(Path.GetFullPath(LuaSetupFile))); DynValue function = lua.LoadFile(LuaSetupFile);
CallLuaFunction(function, Path.GetDirectoryName(Path.GetFullPath(LuaSetupFile)));
} }
catch (Exception e) catch (Exception e)
{ {
@@ -493,7 +494,7 @@ modding needs.
try try
{ {
string luaPath = Path.Combine(path, "Binary/Lua/LuaSetup.lua"); string luaPath = Path.Combine(path, "Binary/Lua/LuaSetup.lua");
lua.Call(lua.LoadFile(luaPath), Path.GetDirectoryName(luaPath)); CallLuaFunction(lua.LoadFile(luaPath), Path.GetDirectoryName(Path.GetFullPath(luaPath)));
} }
catch (Exception e) catch (Exception e)
{ {