diff --git a/Subsurface/Source/Items/CharacterInventory.cs b/Subsurface/Source/Items/CharacterInventory.cs index 08f4d584e..928fccc9b 100644 --- a/Subsurface/Source/Items/CharacterInventory.cs +++ b/Subsurface/Source/Items/CharacterInventory.cs @@ -143,7 +143,16 @@ namespace Barotrauma /// public override bool TryPutItem(Item item, List allowedSlots = null, bool createNetworkEvent = true) { - if (allowedSlots == null || ! allowedSlots.Any()) return false; + if (allowedSlots == null || !allowedSlots.Any()) return false; + + for (int i = 0; i < capacity; i++) + { + //already in the inventory and in a suitable slot + if (Items[i] == item && allowedSlots.Any(a => a.HasFlag(limbSlots[i]))) + { + return true; + } + } //try to place the item in LimBlot.Any slot if that's allowed if (allowedSlots.Contains(InvSlotType.Any)) diff --git a/Subsurface/Source/Items/Inventory.cs b/Subsurface/Source/Items/Inventory.cs index e2d6b85b3..2bee29071 100644 --- a/Subsurface/Source/Items/Inventory.cs +++ b/Subsurface/Source/Items/Inventory.cs @@ -568,7 +568,7 @@ namespace Barotrauma else { var item = Entity.FindEntityByID(newItemIDs[i]) as Item; - if (item == null) continue; + if (item == null || item == Items[i]) continue; if (GameMain.Server != null) { diff --git a/Subsurface/Source/Networking/NetEntityEvent/NetEntityEventManager.cs b/Subsurface/Source/Networking/NetEntityEvent/NetEntityEventManager.cs index 2a76f05f6..ce179e20f 100644 --- a/Subsurface/Source/Networking/NetEntityEvent/NetEntityEventManager.cs +++ b/Subsurface/Source/Networking/NetEntityEvent/NetEntityEventManager.cs @@ -76,7 +76,7 @@ namespace Barotrauma.Networking { long msgPosition = msg.Position; - DebugConsole.NewMessage("received msg "+thisEventID, Microsoft.Xna.Framework.Color.Green); + DebugConsole.NewMessage("received msg "+thisEventID+ " ("+entity.ToString()+")", Microsoft.Xna.Framework.Color.Green); lastReceivedID++; try {