Files
wwdpublic/Content.Server/Alert/Click/StopBeingPulled.cs
metalgearsloth 7e7655b3c4 Pulling rework (#20906)
* Pulling rework

Fixing up the FOUR systems managing pulling, all the shitcode, and also making it nicer ingame.

* More pulling cleanup

* stats

* More cleanup

* First draft

* More pulling

* weh

* Fix puller

* Pulling working

* Fix merge

* Dunked

* Self-merge time

(cherry picked from commit 0d8254b2a2891f8d5623c9878bd0e567d0c7fe3c)
2024-02-08 12:31:57 +01:00

30 lines
898 B
C#

using Content.Shared.ActionBlocker;
using Content.Shared.Alert;
using Content.Shared.Movement.Pulling.Components;
using Content.Shared.Movement.Pulling.Systems;
using JetBrains.Annotations;
namespace Content.Server.Alert.Click
{
/// <summary>
/// Stop pulling something
/// </summary>
[UsedImplicitly]
[DataDefinition]
public sealed partial class StopBeingPulled : IAlertClick
{
public void AlertClicked(EntityUid player)
{
var entityManager = IoCManager.Resolve<IEntityManager>();
if (!entityManager.System<ActionBlockerSystem>().CanInteract(player, null))
return;
if (entityManager.TryGetComponent(player, out PullableComponent? playerPullable))
{
entityManager.System<PullingSystem>().TryStopPull(player, playerPullable, user: player);
}
}
}
}