diff --git a/Barotrauma/BarotraumaClient/Source/Networking/EntitySpawner.cs b/Barotrauma/BarotraumaClient/Source/Networking/EntitySpawner.cs index 1e1df0f69..ea3a65cb8 100644 --- a/Barotrauma/BarotraumaClient/Source/Networking/EntitySpawner.cs +++ b/Barotrauma/BarotraumaClient/Source/Networking/EntitySpawner.cs @@ -17,8 +17,13 @@ namespace Barotrauma var entity = FindEntityByID(entityId); if (entity != null) { + DebugConsole.Log("Received entity removal message for \"" + entity.ToString() + "\"."); entity.Remove(); } + else + { + DebugConsole.Log("Received entity removal message for ID " + entityId + ". Entity with a matching ID not found."); + } } else { diff --git a/Barotrauma/BarotraumaShared/Source/Characters/Character.cs b/Barotrauma/BarotraumaShared/Source/Characters/Character.cs index 6dce22117..a594c9495 100644 --- a/Barotrauma/BarotraumaShared/Source/Characters/Character.cs +++ b/Barotrauma/BarotraumaShared/Source/Characters/Character.cs @@ -1957,6 +1957,10 @@ namespace Barotrauma { isDead = false; + if (aiTarget != null) + { + aiTarget.Remove(); + } aiTarget = new AITarget(this); Health = Math.Max(maxHealth * 0.1f, health); diff --git a/Barotrauma/BarotraumaShared/Source/Items/Components/Holdable/Holdable.cs b/Barotrauma/BarotraumaShared/Source/Items/Components/Holdable/Holdable.cs index 22d855569..6ab3087e7 100644 --- a/Barotrauma/BarotraumaShared/Source/Items/Components/Holdable/Holdable.cs +++ b/Barotrauma/BarotraumaShared/Source/Items/Components/Holdable/Holdable.cs @@ -384,6 +384,11 @@ namespace Barotrauma.Items.Components public void ServerWrite(NetBuffer msg, Client c, object[] extraData = null) { + if (!attachable) + { + DebugConsole.ThrowError("Sent an attachment event for an item that's not attachable."); + } + msg.Write(Attached); } diff --git a/Barotrauma/BarotraumaShared/Source/Items/Item.cs b/Barotrauma/BarotraumaShared/Source/Items/Item.cs index e29dca32f..77f91b451 100644 --- a/Barotrauma/BarotraumaShared/Source/Items/Item.cs +++ b/Barotrauma/BarotraumaShared/Source/Items/Item.cs @@ -1555,6 +1555,8 @@ namespace Barotrauma ushort inventoryId = msg.ReadUInt16(); + DebugConsole.Log("Received entity spawn message for item " + itemName + "."); + Vector2 pos = Vector2.Zero; Submarine sub = null; int inventorySlotIndex = -1;