break pulls when objects are anchored (#3248)
Co-authored-by: cyclowns <cyclowns@protonmail.ch>
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Content.Server.GameObjects.Components.Interactable;
|
using Content.Server.GameObjects.Components.Interactable;
|
||||||
|
using Content.Server.GameObjects.Components.Pulling;
|
||||||
using Content.Server.Utility;
|
using Content.Server.Utility;
|
||||||
using Content.Shared.GameObjects.Components.Interactable;
|
using Content.Shared.GameObjects.Components.Interactable;
|
||||||
using Content.Shared.Interfaces.GameObjects.Components;
|
using Content.Shared.Interfaces.GameObjects.Components;
|
||||||
@@ -76,6 +77,14 @@ namespace Content.Server.GameObjects.Components
|
|||||||
var physics = Owner.GetComponent<IPhysicsComponent>();
|
var physics = Owner.GetComponent<IPhysicsComponent>();
|
||||||
physics.Anchored = true;
|
physics.Anchored = true;
|
||||||
|
|
||||||
|
if (Owner.TryGetComponent(out PullableComponent? pullableComponent))
|
||||||
|
{
|
||||||
|
if (pullableComponent.Puller != null)
|
||||||
|
{
|
||||||
|
pullableComponent.TryStopPull();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (Snap)
|
if (Snap)
|
||||||
Owner.SnapToGrid(SnapGridOffset.Center, Owner.EntityManager);
|
Owner.SnapToGrid(SnapGridOffset.Center, Owner.EntityManager);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user