Fix scram! implant keeping you pulled to someone when teleporting you (#26309)

* Fix scram! implant keeping you pulled to someone when teleporting you

* Exorcise sleep deprivation speak

(cherry picked from commit eb80d9752e0309f8485478a43bcba6fb15fc3711)
This commit is contained in:
nikthechampiongr 2024-03-21 19:42:32 +02:00 committed by NullWanderer
parent 7920cf93ee
commit 4b8355840b
No known key found for this signature in database
GPG Key ID: 65CF92BD1D26F4AC
1 changed files with 8 additions and 0 deletions

View 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);