]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Prevent pulling when teleporting (#33252)
authorPreston Smith <92108534+thetolbean@users.noreply.github.com>
Mon, 16 Dec 2024 14:09:17 +0000 (08:09 -0600)
committerGitHub <noreply@github.com>
Mon, 16 Dec 2024 14:09:17 +0000 (17:09 +0300)
* No more teleporting pulling

* pulled dash

* Update Content.Shared/Ninja/Systems/DashAbilitySystem.cs

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
* Update Content.Server/Implants/SubdermalImplantSystem.cs

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
Content.Server/Implants/SubdermalImplantSystem.cs
Content.Shared/Ninja/Systems/DashAbilitySystem.cs

index 6e277dd29fb4254e22bbfcb6af173c664a0de133..0c86e2f65925b183b86da46bbfab70c51fd803c9 100644 (file)
@@ -109,6 +109,10 @@ public sealed class SubdermalImplantSystem : SharedSubdermalImplantSystem
         if (TryComp<PullableComponent>(ent, out var pull) && _pullingSystem.IsPulled(ent, pull))
             _pullingSystem.TryStopPull(ent, pull);
 
+        // Check if the user is pulling anything, and drop it if so
+        if (TryComp<PullerComponent>(ent, out var puller) && TryComp<PullableComponent>(puller.Pulling, out var pullable))
+            _pullingSystem.TryStopPull(puller.Pulling.Value, pullable);
+
         var xform = Transform(ent);
         var targetCoords = SelectRandomTileInRange(xform, implant.TeleportRadius);
 
index 09be10850582b9c5f8495e51ec066353b89602e6..830b51d5ad4997e2ab057815740e807692d61caa 100644 (file)
@@ -1,8 +1,12 @@
 using Content.Shared.Actions;
 using Content.Shared.Charges.Components;
 using Content.Shared.Charges.Systems;
+using Content.Shared.Hands.Components;
 using Content.Shared.Hands.EntitySystems;
 using Content.Shared.Interaction;
+using Content.Shared.Movement.Pulling.Components;
+using Content.Shared.Movement.Pulling.Events;
+using Content.Shared.Movement.Pulling.Systems;
 using Content.Shared.Ninja.Components;
 using Content.Shared.Popups;
 using Content.Shared.Examine;
@@ -22,6 +26,7 @@ public sealed class DashAbilitySystem : EntitySystem
     [Dependency] private readonly SharedHandsSystem _hands = default!;
     [Dependency] private readonly ExamineSystemShared _examine = default!;
     [Dependency] private readonly SharedPopupSystem _popup = default!;
+    [Dependency] private readonly PullingSystem _pullingSystem = default!;
     [Dependency] private readonly SharedTransformSystem _transform = default!;
 
     public override void Initialize()
@@ -80,6 +85,14 @@ public sealed class DashAbilitySystem : EntitySystem
             return;
         }
 
+        // Check if the user is BEING pulled, and escape if so
+        if (TryComp<PullableComponent>(user, out var pull) && _pullingSystem.IsPulled(user, pull))
+            _pullingSystem.TryStopPull(user, pull);
+
+        // Check if the user is pulling anything, and drop it if so
+        if (TryComp<PullerComponent>(user, out var puller) && TryComp<PullableComponent>(puller.Pulling, out var pullable))
+            _pullingSystem.TryStopPull(puller.Pulling.Value, pullable);
+
         var xform = Transform(user);
         _transform.SetCoordinates(user, xform, args.Target);
         _transform.AttachToGridOrMap(user, xform);