diff --git a/Content.Shared/Weapons/Misc/SharedTetherGunSystem.cs b/Content.Shared/Weapons/Misc/SharedTetherGunSystem.cs index 1e4e890224..3c88e716b6 100644 --- a/Content.Shared/Weapons/Misc/SharedTetherGunSystem.cs +++ b/Content.Shared/Weapons/Misc/SharedTetherGunSystem.cs @@ -45,10 +45,26 @@ public abstract partial class SharedTetherGunSystem : EntitySystem SubscribeLocalEvent(OnTetheredBuckleAttempt); SubscribeLocalEvent(OnTetheredUpdateCanMove); + SubscribeLocalEvent(OnTetheredContainerInserted); InitializeForce(); } + private void OnTetheredContainerInserted(EntityUid uid, TetheredComponent component, EntGotInsertedIntoContainerMessage args) + { + if (TryComp(component.Tetherer, out var tetherGun)) + { + StopTether(component.Tetherer, tetherGun); + return; + } + + if (TryComp(component.Tetherer, out var forceGun)) + { + StopTether(component.Tetherer, forceGun); + return; + } + } + private void OnTetheredBuckleAttempt(EntityUid uid, TetheredComponent component, ref BuckleAttemptEvent args) { args.Cancelled = true; @@ -152,7 +168,8 @@ public abstract partial class SharedTetherGunSystem : EntitySystem if (HasComp(target) || !TryComp(target, out var physics)) return false; - if (physics.BodyType == BodyType.Static && !component.CanUnanchor) + if (physics.BodyType == BodyType.Static && !component.CanUnanchor || + _container.IsEntityInContainer(target)) return false; if (physics.Mass > component.MassLimit)