mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* IoC source gen compatibility Can be merged before or after https://github.com/space-wizards/RobustToolbox/pull/6549 doesn't really matter. * Missed a spot
19 lines
679 B
C#
19 lines
679 B
C#
using Content.Shared.Cuffs;
|
|
using Content.Shared.Cuffs.Components;
|
|
using Content.Shared.Trigger.Components.Effects;
|
|
|
|
namespace Content.Shared.Trigger.Systems;
|
|
|
|
public sealed partial class UncuffOnTriggerSystem : XOnTriggerSystem<UncuffOnTriggerComponent>
|
|
{
|
|
[Dependency] private SharedCuffableSystem _cuffable = default!;
|
|
|
|
protected override void OnTrigger(Entity<UncuffOnTriggerComponent> ent, EntityUid target, ref TriggerEvent args)
|
|
{
|
|
if (!TryComp<CuffableComponent>(target, out var cuffs) || !_cuffable.TryGetLastCuff(target, out var cuff))
|
|
return;
|
|
|
|
_cuffable.Uncuff(target, args.User, cuff.Value);
|
|
args.Handled = true;
|
|
}
|
|
}
|