Update Moonsharp for the new pcall exception handling
This commit is contained in:
@@ -53,7 +53,14 @@ luaUserData.AddCallMetaTable = function (userdata)
|
||||
error("userdata was nil.", 2)
|
||||
end
|
||||
|
||||
return userdata.__new(...)
|
||||
local success, result = pcall(userdata.__new, ...)
|
||||
|
||||
|
||||
if not success then
|
||||
error(result, 2)
|
||||
end
|
||||
|
||||
return result
|
||||
end
|
||||
})
|
||||
end
|
||||
|
||||
@@ -271,6 +271,7 @@ namespace Barotrauma
|
||||
Lua.Options.DebugPrint = PrintMessage;
|
||||
Lua.Options.ScriptLoader = LuaScriptLoader;
|
||||
Lua.Options.CheckThreadAccess = false;
|
||||
Script.GlobalOptions.ShouldPCallCatchException = (Exception ex) => { return true; };
|
||||
CsScript = new CsScriptRunner(this);
|
||||
|
||||
require = new LuaRequire(Lua);
|
||||
|
||||
Submodule Libraries/moonsharp updated: 267b6a25c8...2a70d42779
Reference in New Issue
Block a user