Skip to content

Commit

Permalink
Merge pull request Simple-Station#147 from Mnemotechnician/fix/leash-…
Browse files Browse the repository at this point in the history
…portals

Break Leash Joints (and All Other Joints) when Entering a Portal
  • Loading branch information
Memeji committed Aug 24, 2024
2 parents f2a0e37 + 069eab9 commit aa4a9a3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Content.Shared/Teleportation/Systems/SharedPortalSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using Robust.Shared.Network;
using Robust.Shared.Physics.Dynamics;
using Robust.Shared.Physics.Events;
using Robust.Shared.Physics.Systems;
using Robust.Shared.Player;
using Robust.Shared.Random;
using Robust.Shared.Utility;
Expand All @@ -30,6 +31,7 @@ public abstract class SharedPortalSystem : EntitySystem
[Dependency] private readonly SharedTransformSystem _transform = default!;
[Dependency] private readonly PullingSystem _pulling = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly SharedJointSystem _joints = default!; // Floofstation

private const string PortalFixture = "portalFixture";
private const string ProjectileFixture = "projectile";
Expand Down Expand Up @@ -207,6 +209,8 @@ private void TeleportEntity(EntityUid portal, EntityUid subject, EntityCoordinat

LogTeleport(portal, subject, Transform(subject).Coordinates, target);

_joints.RecursiveClearJoints(subject); // Floofstation - clear all joints on teleported entities so they don't end up being pulled 'cross the map or worse.

_transform.SetCoordinates(subject, target);

if (!playSound)
Expand Down

0 comments on commit aa4a9a3

Please sign in to comment.