Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent pulling when teleporting #33252

Merged
merged 6 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Content.Server/Implants/SubdermalImplantSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ private void OnScramImplant(EntityUid uid, SubdermalImplantComponent component,
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(ent, out PullerComponent? puller) && TryComp(puller.Pulling, out PullableComponent? pullable))
thetolbean marked this conversation as resolved.
Show resolved Hide resolved
_pullingSystem.TryStopPull(puller.Pulling.Value, pullable);

var xform = Transform(ent);
var targetCoords = SelectRandomTileInRange(xform, implant.TeleportRadius);

Expand Down
13 changes: 13 additions & 0 deletions Content.Shared/Ninja/Systems/DashAbilitySystem.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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()
Expand Down Expand Up @@ -80,6 +85,14 @@ private void OnDash(Entity<DashAbilityComponent> ent, ref DashEvent args)
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(user, out PullerComponent? puller) && TryComp(puller.Pulling, out PullableComponent? pullable))
thetolbean marked this conversation as resolved.
Show resolved Hide resolved
_pullingSystem.TryStopPull(puller.Pulling.Value, pullable);

var xform = Transform(user);
_transform.SetCoordinates(user, xform, args.Target);
_transform.AttachToGridOrMap(user, xform);
Expand Down
Loading