From d13593b27ee50131b0890ae724984cf8807c50b2 Mon Sep 17 00:00:00 2001 From: Kara Date: Thu, 5 Jan 2023 05:36:25 -0600 Subject: [PATCH] Portal pull fix (#13336) --- .../Teleportation/Systems/PortalSystem.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Content.Shared/Teleportation/Systems/PortalSystem.cs b/Content.Shared/Teleportation/Systems/PortalSystem.cs index 841c3411a5..497730da59 100644 --- a/Content.Shared/Teleportation/Systems/PortalSystem.cs +++ b/Content.Shared/Teleportation/Systems/PortalSystem.cs @@ -1,5 +1,7 @@ using System.Linq; using Content.Shared.Projectiles; +using Content.Shared.Pulling; +using Content.Shared.Pulling.Components; using Content.Shared.Teleportation.Components; using Robust.Shared.GameStates; using Robust.Shared.Map; @@ -19,6 +21,7 @@ public sealed class PortalSystem : EntitySystem [Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly INetManager _netMan = default!; [Dependency] private readonly SharedAudioSystem _audio = default!; + [Dependency] private readonly SharedPullingSystem _pulling = default!; private const string PortalFixture = "portalFixture"; private const string ProjectileFixture = "projectile"; @@ -62,6 +65,18 @@ public sealed class PortalSystem : EntitySystem if (Transform(subject).Anchored) return; + // break pulls before portal enter so we dont break shit + if (TryComp(subject, out var pullable) && pullable.BeingPulled) + { + _pulling.TryStopPull(pullable); + } + + if (TryComp(subject, out var pulling) + && pulling.Pulling != null && TryComp(pulling.Pulling.Value, out var subjectPulling)) + { + _pulling.TryStopPull(subjectPulling); + } + // if they came from another portal, just return and wait for them to exit the portal if (HasComp(subject)) {