CatStation/Content.Shared/Trigger/Systems/UncuffOnTriggerSystem.cs
Pieter-Jan Briers 5168b5f3d4
IoC source gen compatibility (#43863)
* 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
2026-05-09 03:29:58 +00:00

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;
}
}