we don't actually need to check for threads if theres only one (multiplayer)

This commit is contained in:
Evil Factory
2022-04-24 00:01:43 -03:00
parent fe3d17d1d9
commit 2c1329fa36
@@ -302,12 +302,6 @@ namespace Barotrauma
}
public object CallLuaFunction(object function, params object[] arguments)
{
if (Thread.CurrentThread != GameMain.MainThread)
{
PrintMessage($"Warning: Tried to call Lua function outside of the main thread. Arguments = {string.Join(' ', arguments)}, {Environment.StackTrace}");
return null;
}
try
{
return lua.Call(function, arguments);
@@ -390,6 +384,7 @@ namespace Barotrauma
lua = new Script(CoreModules.Preset_SoftSandbox | CoreModules.Debug);
lua.Options.DebugPrint = PrintMessage;
lua.Options.ScriptLoader = LuaScriptLoader;
lua.Options.CheckThreadAccess = false;
Lua = new CsLua(this);
CsScript = new CsScriptRunner(this);