diff --git a/Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs b/Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs index 3d2d263652..85d7698ff0 100644 --- a/Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs +++ b/Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs @@ -458,7 +458,7 @@ public abstract partial class SharedBuckleSystem var buckleXform = Transform(buckle); var oldBuckledXform = Transform(strap); - if (buckleXform.ParentUid == strap.Owner && !Terminating(buckleXform.ParentUid)) + if (buckleXform.ParentUid == strap.Owner && !Terminating(oldBuckledXform.ParentUid)) { _transform.PlaceNextTo((buckle, buckleXform), (strap.Owner, oldBuckledXform)); buckleXform.ActivelyLerping = false; diff --git a/Content.Shared/Buckle/SharedBuckleSystem.Strap.cs b/Content.Shared/Buckle/SharedBuckleSystem.Strap.cs index bfb0cd9cd6..c101340421 100644 --- a/Content.Shared/Buckle/SharedBuckleSystem.Strap.cs +++ b/Content.Shared/Buckle/SharedBuckleSystem.Strap.cs @@ -14,6 +14,7 @@ public abstract partial class SharedBuckleSystem { SubscribeLocalEvent(OnStrapStartup); SubscribeLocalEvent(OnStrapShutdown); + SubscribeLocalEvent(OnStrapTerminating); SubscribeLocalEvent((e, c, _) => StrapRemoveAll(e, c)); SubscribeLocalEvent(OnStrapContainerGettingInsertedAttempt); @@ -35,6 +36,11 @@ public abstract partial class SharedBuckleSystem StrapRemoveAll(uid, component); } + private void OnStrapTerminating(Entity entity, ref EntityTerminatingEvent args) + { + StrapRemoveAll(entity, entity.Comp); + } + private void OnStrapContainerGettingInsertedAttempt(EntityUid uid, StrapComponent component, ContainerGettingInsertedAttemptEvent args) { // If someone is attempting to put this item inside of a backpack, ensure that it has no entities strapped to it.