From 06f40fa3684f19109d2ea5f97a1c762e5cd02a37 Mon Sep 17 00:00:00 2001 From: Evil Factory <36804725+evilfactory@users.noreply.github.com> Date: Tue, 10 Aug 2021 23:34:07 -0300 Subject: [PATCH] more --- Barotrauma/BarotraumaServer/ServerSource/Lua/LuaClasses.cs | 2 ++ Barotrauma/BarotraumaServer/ServerSource/Lua/LuaSetup.cs | 2 ++ .../BarotraumaServer/ServerSource/Networking/ChatMessage.cs | 2 +- Barotrauma/BarotraumaShared/SharedSource/Items/Item.cs | 1 - 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Barotrauma/BarotraumaServer/ServerSource/Lua/LuaClasses.cs b/Barotrauma/BarotraumaServer/ServerSource/Lua/LuaClasses.cs index 3e0d46da4..758b5b4e1 100644 --- a/Barotrauma/BarotraumaServer/ServerSource/Lua/LuaClasses.cs +++ b/Barotrauma/BarotraumaServer/ServerSource/Lua/LuaClasses.cs @@ -238,6 +238,8 @@ namespace Barotrauma public static Submarine GetRespawnSub() { + if (GameMain.Server.RespawnManager == null) + return null; return GameMain.Server.RespawnManager.RespawnShuttle; } diff --git a/Barotrauma/BarotraumaServer/ServerSource/Lua/LuaSetup.cs b/Barotrauma/BarotraumaServer/ServerSource/Lua/LuaSetup.cs index a83f4162e..06d3284b7 100644 --- a/Barotrauma/BarotraumaServer/ServerSource/Lua/LuaSetup.cs +++ b/Barotrauma/BarotraumaServer/ServerSource/Lua/LuaSetup.cs @@ -137,6 +137,8 @@ namespace Barotrauma UserData.RegisterType(); UserData.RegisterType(); UserData.RegisterType(); + UserData.RegisterType(); + UserData.RegisterType(); lua = new Script(CoreModules.Preset_SoftSandbox | CoreModules.LoadMethods); diff --git a/Barotrauma/BarotraumaServer/ServerSource/Networking/ChatMessage.cs b/Barotrauma/BarotraumaServer/ServerSource/Networking/ChatMessage.cs index 50a463902..bbb1d8aed 100644 --- a/Barotrauma/BarotraumaServer/ServerSource/Networking/ChatMessage.cs +++ b/Barotrauma/BarotraumaServer/ServerSource/Networking/ChatMessage.cs @@ -117,7 +117,7 @@ namespace Barotrauma.Networking return; } - var should = GameMain.Lua.hook.Call("chatMessage", new DynValue[] { DynValue.NewString(txt), UserData.Create(c) }); + var should = GameMain.Lua.hook.Call("chatMessage", new DynValue[] { DynValue.NewString(txt), UserData.Create(c), UserData.Create(type) }); if(should != null) diff --git a/Barotrauma/BarotraumaShared/SharedSource/Items/Item.cs b/Barotrauma/BarotraumaShared/SharedSource/Items/Item.cs index d2a41d00c..3755c7080 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/Items/Item.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/Items/Item.cs @@ -2226,7 +2226,6 @@ namespace Barotrauma if (condition == 0.0f) { return; } - #if SERVER var should = GameMain.Lua.hook.Call("itemUse", new DynValue[] { LuaSetup.CreateUserDataSafe(this), LuaSetup.CreateUserDataSafe(character), LuaSetup.CreateUserDataSafe(targetLimb) });