fix formatting in lua require and better error handling with dofile,loadfile,etc

This commit is contained in:
Evil Factory
2022-05-04 08:50:17 -03:00
parent 7a6ddccbb7
commit bbea195e7d
6 changed files with 148 additions and 169 deletions
@@ -1243,7 +1243,14 @@ namespace Barotrauma
commands.Add(new Command("lua", "lua: runs a string", (string[] args) =>
{
GameMain.LuaCs.Lua.DoString(string.Join(" ", args));
try
{
GameMain.LuaCs.Lua.DoString(string.Join(" ", args));
}
catch (Exception ex)
{
GameMain.LuaCs.HandleException(ex);
}
}));
commands.Add(new Command("cs", "cs: runs a string", (string[] args) =>
{