diff --git a/Content.Shared/Cuffs/SharedCuffableSystem.cs b/Content.Shared/Cuffs/SharedCuffableSystem.cs index 2cf87ea96c..f513bb4aa3 100644 --- a/Content.Shared/Cuffs/SharedCuffableSystem.cs +++ b/Content.Shared/Cuffs/SharedCuffableSystem.cs @@ -134,11 +134,11 @@ namespace Content.Shared.Cuffs private void OnCuffsRemovedFromContainer(EntityUid uid, CuffableComponent component, EntRemovedFromContainerMessage args) { - if (args.Container.ID == component.Container.ID) - { - _handVirtualItem.DeleteInHandsMatching(uid, args.Entity); - UpdateCuffState(uid, component); - } + if (args.Container.ID != component.Container.ID) + return; + + _handVirtualItem.DeleteInHandsMatching(uid, args.Entity); + UpdateCuffState(uid, component); } private void OnCuffsInsertedIntoContainer(EntityUid uid, CuffableComponent component, ContainerModifiedMessage args) diff --git a/Content.Shared/Hands/SharedHandVirtualItemSystem.cs b/Content.Shared/Hands/SharedHandVirtualItemSystem.cs index e33ffdf051..037b36d4a8 100644 --- a/Content.Shared/Hands/SharedHandVirtualItemSystem.cs +++ b/Content.Shared/Hands/SharedHandVirtualItemSystem.cs @@ -48,6 +48,11 @@ public abstract class SharedHandVirtualItemSystem : EntitySystem /// public void DeleteInHandsMatching(EntityUid user, EntityUid matching) { + // Client can't currently predict deleting network entities atm and this might happen due to the + // hands leaving PVS for example, in which case we wish to ignore it. + if (_net.IsClient) + return; + foreach (var hand in _hands.EnumerateHands(user)) { if (TryComp(hand.HeldEntity, out HandVirtualItemComponent? virt) && virt.BlockingEntity == matching)