From 8a8018509d1368f43547b77ffd9c0872f39b421e Mon Sep 17 00:00:00 2001 From: Evil Factory <36804725+evilfactory@users.noreply.github.com> Date: Mon, 19 Jul 2021 00:12:41 -0300 Subject: [PATCH] fixes --- Barotrauma/BarotraumaServer/ServerSource/Lua/LuaClasses.cs | 5 +++++ Barotrauma/BarotraumaShared/SharedSource/Items/Item.cs | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Barotrauma/BarotraumaServer/ServerSource/Lua/LuaClasses.cs b/Barotrauma/BarotraumaServer/ServerSource/Lua/LuaClasses.cs index 54e105598..f2b2ed7ee 100644 --- a/Barotrauma/BarotraumaServer/ServerSource/Lua/LuaClasses.cs +++ b/Barotrauma/BarotraumaServer/ServerSource/Lua/LuaClasses.cs @@ -52,6 +52,11 @@ namespace Barotrauma character.TeamID = (CharacterTeamType)team; } + public static void SetClientTeam(Client character, int team) + { + character.TeamID = (CharacterTeamType)team; + } + public static void Kick(Client client, string reason = "") { GameMain.Server.KickClient(client.Connection, reason); diff --git a/Barotrauma/BarotraumaShared/SharedSource/Items/Item.cs b/Barotrauma/BarotraumaShared/SharedSource/Items/Item.cs index d93664572..ffb0d38cf 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/Items/Item.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/Items/Item.cs @@ -2643,7 +2643,8 @@ namespace Barotrauma } logPropertyChangeCoroutine = CoroutineManager.InvokeAfter(() => { - GameServer.Log($"{sender.Character.Name} set the value \"{property.Name}\" of the item \"{Name}\" to \"{logValue}\".", ServerLog.MessageType.ItemInteraction); + if(sender.Character != null) + GameServer.Log($"{sender.Character.Name} set the value \"{property.Name}\" of the item \"{Name}\" to \"{logValue}\".", ServerLog.MessageType.ItemInteraction); }, delay: 1.0f); } #endif