diff --git a/Subsurface/Source/Items/Item.cs b/Subsurface/Source/Items/Item.cs index 25326cc6a..3acea3114 100644 --- a/Subsurface/Source/Items/Item.cs +++ b/Subsurface/Source/Items/Item.cs @@ -2289,6 +2289,8 @@ namespace Barotrauma if (GameMain.Server == null) return; int index = components.IndexOf(ic); + if (index == -1) return; + GameMain.Server.CreateEntityEvent(this, new object[] { NetEntityEvent.Type.ComponentState, index }); } @@ -2297,6 +2299,8 @@ namespace Barotrauma if (GameMain.Client == null) return; int index = components.IndexOf(ic); + if (index == -1) return; + GameMain.Client.CreateEntityEvent(this, new object[] { NetEntityEvent.Type.ComponentState, index }); }