Files
tbd-station-14/Content.Server/Alert/Click/StopBeingPulled.cs
2022-05-13 17:59:03 +10:00

28 lines
803 B
C#

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