Reimplementation of DoString with lua/cl_lua commands and fix Lua scripts not being loaded properly

This commit is contained in:
Evil Factory
2026-01-28 23:41:23 -03:00
committed by Maplewheels
parent f0f09c20fa
commit 67d3d5f587
6 changed files with 28 additions and 34 deletions
@@ -1291,15 +1291,8 @@ namespace Barotrauma
commands.Add(new Command("lua", "lua: Runs a string.", (string[] args) =>
{
try
{
throw new NotImplementedException();
//GameMain.LuaCs.Lua.DoString(string.Join(" ", args));
}
catch (Exception ex)
{
LuaCsLogger.HandleException(ex, LuaCsMessageOrigin.LuaMod);
}
var result = GameMain.LuaCs.LuaScriptManagementService.DoString(string.Join(" ", args));
GameMain.LuaCs.Logger.LogResults(result.ToResult());
}));
commands.Add(new Command("reloadlua|reloadcs|reloadluacs", "Re-initializes the LuaCs environment.", (string[] args) =>