2021-10-11 15:23:45 -07:00
|
|
|
using Content.Shared.ActionBlocker;
|
2021-03-08 12:10:48 +11:00
|
|
|
using Content.Shared.Alert;
|
2021-06-09 22:19:39 +02:00
|
|
|
using Content.Shared.Pulling.Components;
|
2021-10-04 16:10:54 +01:00
|
|
|
using Content.Shared.Pulling;
|
2021-03-08 12:10:48 +11:00
|
|
|
using JetBrains.Annotations;
|
2021-10-04 16:10:54 +01:00
|
|
|
using Robust.Shared.GameObjects;
|
2021-12-03 14:17:01 +01:00
|
|
|
using Robust.Shared.IoC;
|
2021-03-08 12:10:48 +11:00
|
|
|
using Robust.Shared.Serialization.Manager.Attributes;
|
|
|
|
|
|
|
|
|
|
namespace Content.Server.Alert.Click
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Stop pulling something
|
|
|
|
|
/// </summary>
|
|
|
|
|
[UsedImplicitly]
|
|
|
|
|
[DataDefinition]
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class StopBeingPulled : IAlertClick
|
2021-03-08 12:10:48 +11:00
|
|
|
{
|
2022-01-05 00:19:23 -08:00
|
|
|
public void AlertClicked(EntityUid player)
|
2021-03-08 12:10:48 +11:00
|
|
|
{
|
2022-02-15 17:06:52 +13:00
|
|
|
if (!EntitySystem.Get<ActionBlockerSystem>().CanInteract(player, null))
|
2021-10-11 15:23:45 -07:00
|
|
|
return;
|
|
|
|
|
|
2022-01-05 00:19:23 -08:00
|
|
|
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<SharedPullableComponent?>(player, out var playerPullable))
|
2021-10-04 16:10:54 +01:00
|
|
|
{
|
2021-10-05 14:29:03 +11:00
|
|
|
EntitySystem.Get<SharedPullingSystem>().TryStopPull(playerPullable);
|
2021-10-04 16:10:54 +01:00
|
|
|
}
|
2021-03-08 12:10:48 +11:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|