diff --git a/Barotrauma/BarotraumaClient/Source/Characters/Health/CharacterHealth.cs b/Barotrauma/BarotraumaClient/Source/Characters/Health/CharacterHealth.cs index 914ec1ee8..04cb8c620 100644 --- a/Barotrauma/BarotraumaClient/Source/Characters/Health/CharacterHealth.cs +++ b/Barotrauma/BarotraumaClient/Source/Characters/Health/CharacterHealth.cs @@ -448,8 +448,8 @@ namespace Barotrauma else { forceAfflictionContainerUpdate = true; - currentDisplayedAfflictions = GetAllAfflictions() - .Where(a => a.Strength >= a.Prefab.ShowIconThreshold && a.Prefab.Icon != null).ToList(); + currentDisplayedAfflictions = GetAllAfflictions(mergeSameAfflictions: true) + .FindAll(a => a.Strength >= a.Prefab.ShowIconThreshold && a.Prefab.Icon != null); currentDisplayedAfflictions.Sort((a1, a2) => { int dmgPerSecond = Math.Sign(a2.DamagePerSecond - a1.DamagePerSecond); diff --git a/Barotrauma/BarotraumaShared/Source/Items/Components/Door.cs b/Barotrauma/BarotraumaShared/Source/Items/Components/Door.cs index 3eceabb0c..8fed8a9ae 100644 --- a/Barotrauma/BarotraumaShared/Source/Items/Components/Door.cs +++ b/Barotrauma/BarotraumaShared/Source/Items/Components/Door.cs @@ -471,11 +471,12 @@ namespace Barotrauma.Items.Components if (connection.Name == "toggle") { - switch (subElement.Name.ToString().ToLowerInvariant()) - { - case "requireditem": - if (!overrideRequiredItems) requiredItems.Clear(); - overrideRequiredItems = true; + SetState(!wasOpen, false, true); + } + else if (connection.Name == "set_state") + { + SetState(signal != "0", false, true); + } #if SERVER if (sender != null && wasOpen != isOpen) diff --git a/Barotrauma/BarotraumaShared/Source/Items/Components/Holdable/Throwable.cs b/Barotrauma/BarotraumaShared/Source/Items/Components/Holdable/Throwable.cs index b6107eada..7fb161dfa 100644 --- a/Barotrauma/BarotraumaShared/Source/Items/Components/Holdable/Throwable.cs +++ b/Barotrauma/BarotraumaShared/Source/Items/Components/Holdable/Throwable.cs @@ -99,13 +99,13 @@ namespace Barotrauma.Items.Components { Vector2 throwVector = Vector2.Normalize(picker.CursorWorldPosition - picker.WorldPosition); //throw upwards if cursor is at the position of the character - if (!MathUtils.IsValid(throwVector)) throwVector = Vector2.UnitY; + if (!MathUtils.IsValid(throwVector)) { throwVector = Vector2.UnitY; } #if SERVER GameServer.Log(picker.LogName + " threw " + item.Name, ServerLog.MessageType.ItemInteraction); #endif - item.Drop(picker); + item.Drop(picker, createNetworkEvent: GameMain.NetworkMember == null || GameMain.NetworkMember.IsServer); item.body.ApplyLinearImpulse(throwVector * throwForce * item.body.Mass * 3.0f); ac.GetLimb(LimbType.Head).body.ApplyLinearImpulse(throwVector*10.0f); diff --git a/Barotrauma/BarotraumaShared/Source/Items/Item.cs b/Barotrauma/BarotraumaShared/Source/Items/Item.cs index 4a3b39c6a..434281de1 100644 --- a/Barotrauma/BarotraumaShared/Source/Items/Item.cs +++ b/Barotrauma/BarotraumaShared/Source/Items/Item.cs @@ -1562,12 +1562,15 @@ namespace Barotrauma return isCombined; } - public void Drop(Character dropper) + public void Drop(Character dropper, bool createNetworkEvent = true) { - if (parentInventory != null && !parentInventory.Owner.Removed && !Removed && - GameMain.NetworkMember != null && (GameMain.NetworkMember.IsServer || Character.Controlled == dropper)) + if (createNetworkEvent) { - parentInventory.CreateNetworkEvent(); + if (parentInventory != null && !parentInventory.Owner.Removed && !Removed && + GameMain.NetworkMember != null && (GameMain.NetworkMember.IsServer || Character.Controlled == dropper)) + { + parentInventory.CreateNetworkEvent(); + } } foreach (ItemComponent ic in components) { ic.Drop(dropper); }