From bae0dbd0e5df43be259a232a74e4372c08bf5b84 Mon Sep 17 00:00:00 2001 From: Evil Factory <36804725+evilfactory@users.noreply.github.com> Date: Fri, 6 Aug 2021 15:53:12 -0300 Subject: [PATCH] replace dofile function --- Barotrauma/BarotraumaServer/ServerSource/Lua/LuaSetup.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Barotrauma/BarotraumaServer/ServerSource/Lua/LuaSetup.cs b/Barotrauma/BarotraumaServer/ServerSource/Lua/LuaSetup.cs index e52463508..04f668747 100644 --- a/Barotrauma/BarotraumaServer/ServerSource/Lua/LuaSetup.cs +++ b/Barotrauma/BarotraumaServer/ServerSource/Lua/LuaSetup.cs @@ -67,16 +67,18 @@ namespace Barotrauma } } - public void DoFile(string file) + public DynValue DoFile(string file) { try { - lua.DoFile(file); + return lua.DoFile(file); } catch (Exception e) { HandleLuaException(e); } + + return null; } @@ -130,6 +132,7 @@ namespace Barotrauma hook = new LuaHook(this); game = new LuaGame(this); + lua.Globals["dofile"] = (Func)DoFile; lua.Globals["Player"] = new LuaPlayer(); lua.Globals["Game"] = game; lua.Globals["Hook"] = hook;