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