From f9429da2691c921192017815b1881cee13871718 Mon Sep 17 00:00:00 2001 From: mirrorcult Date: Mon, 15 Feb 2021 18:53:35 -0700 Subject: [PATCH] break pulls when objects are anchored (#3248) Co-authored-by: cyclowns --- .../GameObjects/Components/AnchorableComponent.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Content.Server/GameObjects/Components/AnchorableComponent.cs b/Content.Server/GameObjects/Components/AnchorableComponent.cs index 5410116d88..d6ed4b447e 100644 --- a/Content.Server/GameObjects/Components/AnchorableComponent.cs +++ b/Content.Server/GameObjects/Components/AnchorableComponent.cs @@ -2,6 +2,7 @@ using System.Diagnostics.CodeAnalysis; using System.Threading.Tasks; using Content.Server.GameObjects.Components.Interactable; +using Content.Server.GameObjects.Components.Pulling; using Content.Server.Utility; using Content.Shared.GameObjects.Components.Interactable; using Content.Shared.Interfaces.GameObjects.Components; @@ -76,6 +77,14 @@ namespace Content.Server.GameObjects.Components var physics = Owner.GetComponent(); physics.Anchored = true; + if (Owner.TryGetComponent(out PullableComponent? pullableComponent)) + { + if (pullableComponent.Puller != null) + { + pullableComponent.TryStopPull(); + } + } + if (Snap) Owner.SnapToGrid(SnapGridOffset.Center, Owner.EntityManager);