moved lua initialization to be after the server is running

This commit is contained in:
Evil Factory
2021-09-07 17:32:20 -03:00
parent 76f389dff9
commit 2888383b8f
2 changed files with 4 additions and 4 deletions

View File

@@ -137,9 +137,6 @@ namespace Barotrauma
NetLobbyScreen = new NetLobbyScreen();
CheckContentPackage();
Lua = new LuaSetup();
}

View File

@@ -197,6 +197,8 @@ namespace Barotrauma.Networking
#endif
}
GameMain.Lua = new LuaSetup();
TickRate = serverSettings.TickRate;
Log("Server started", ServerLog.MessageType.ServerMessage);
@@ -3842,7 +3844,8 @@ namespace Barotrauma.Networking
{
if (GameMain.Server == null || !GameMain.Server.ServerSettings.SaveServerLogs) { return; }
GameMain.Lua.hook.Call("serverLog", new object[] { line, messageType });
if(GameMain.Lua != null)
GameMain.Lua.hook.Call("serverLog", new object[] { line, messageType });
GameMain.Server.ServerSettings.ServerLog.WriteLine(line, messageType);