break pulls when objects are anchored (#3248)

Co-authored-by: cyclowns <cyclowns@protonmail.ch>
This commit is contained in:
mirrorcult
2021-02-15 18:53:35 -07:00
committed by GitHub
parent 237e40e60f
commit f9429da269

View File

@@ -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<IPhysicsComponent>();
physics.Anchored = true;
if (Owner.TryGetComponent(out PullableComponent? pullableComponent))
{
if (pullableComponent.Puller != null)
{
pullableComponent.TryStopPull();
}
}
if (Snap)
Owner.SnapToGrid(SnapGridOffset.Center, Owner.EntityManager);