Remove exception handling on Require

This was just eating exceptions; exceptions should instead propagate to a more appropriate handler (`pcall` should now work).
This commit is contained in:
Jacobin
2022-05-04 11:27:46 +10:00
parent c5b6cc5f0d
commit 43f172a190

View File

@@ -318,18 +318,7 @@ namespace Barotrauma
return null;
}
public DynValue Require(string moduleName, Table globalContexts)
{
try
{
return require.Require(moduleName, globalContexts);
}
catch (Exception e)
{
HandleException(e);
}
return null;
}
public object CallLuaFunction(object function, params object[] arguments)
{
try
@@ -444,7 +433,7 @@ namespace Barotrauma
lua.Globals["dofile"] = (Func<string, Table, string, DynValue>)DoFile;
lua.Globals["loadfile"] = (Func<string, Table, string, DynValue>)LoadFile;
lua.Globals["require"] = (Func<string, Table, DynValue>)Require;
lua.Globals["require"] = (Func<string, Table, DynValue>)require.Require;
lua.Globals["dostring"] = (Func<string, Table, string, DynValue>)DoString;
lua.Globals["load"] = (Func<string, Table, string, DynValue>)LoadString;