using Content.Server.Shuttles.EntitySystems;
using Content.Shared.Alert;
using Content.Shared.Shuttles.Components;
using JetBrains.Annotations;
namespace Content.Server.Alert.Click
{
///
/// Stop piloting shuttle
///
[UsedImplicitly]
[DataDefinition]
public sealed class StopPiloting : IAlertClick
{
public void AlertClicked(EntityUid player)
{
if (IoCManager.Resolve().TryGetComponent(player, out PilotComponent? pilotComponent) &&
pilotComponent.Console != null)
{
EntitySystem.Get().RemovePilot(pilotComponent);
}
}
}
}