]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix scram! implant keeping you pulled to someone when teleporting you (#26309)
authornikthechampiongr <32041239+nikthechampiongr@users.noreply.github.com>
Thu, 21 Mar 2024 17:42:32 +0000 (19:42 +0200)
committerGitHub <noreply@github.com>
Thu, 21 Mar 2024 17:42:32 +0000 (18:42 +0100)
* Fix scram! implant keeping you pulled to someone when teleporting you

* Exorcise sleep deprivation speak

Content.Server/Implants/SubdermalImplantSystem.cs

index 8eb274144817398d5c3f7118f4694102da9668f4..6b58f6eb0920dd1d3d373ae75c9e76ad75af19af 100644 (file)
@@ -19,6 +19,8 @@ using Robust.Shared.Physics;
 using Robust.Shared.Physics.Components;
 using Robust.Shared.Random;
 using System.Numerics;
+using Content.Shared.Movement.Pulling.Components;
+using Content.Shared.Movement.Pulling.Systems;
 
 namespace Content.Server.Implants;
 
@@ -34,6 +36,7 @@ public sealed class SubdermalImplantSystem : SharedSubdermalImplantSystem
     [Dependency] private readonly SharedPopupSystem _popup = default!;
     [Dependency] private readonly SharedTransformSystem _xform = default!;
     [Dependency] private readonly ForensicsSystem _forensicsSystem = default!;
+    [Dependency] private readonly PullingSystem _pullingSystem = default!;
 
     private EntityQuery<PhysicsComponent> _physicsQuery;
 
@@ -98,6 +101,11 @@ public sealed class SubdermalImplantSystem : SharedSubdermalImplantSystem
         if (!TryComp<ScramImplantComponent>(uid, out var implant))
             return;
 
+        // We need stop the user from being pulled so they don't just get "attached" with whoever is pulling them.
+        // This can for example happen when the user is cuffed and being pulled.
+        if (TryComp<PullableComponent>(ent, out var pull) && _pullingSystem.IsPulled(ent, pull))
+            _pullingSystem.TryStopPull(ent, pull);
+
         var xform = Transform(ent);
         var entityCoords = xform.Coordinates.ToMap(EntityManager, _xform);