CatStation/Content.Shared/Trigger/Systems/TriggerOnToolUseSystem.cs
_Svist_ 5e282f5b25
Fix TriggerOnToolUseSystem (#44910)
* da

* :(

Co-authored-by: ScarKy0 <106310278+ScarKy0@users.noreply.github.com>

* .

---------

Co-authored-by: ScarKy0 <106310278+ScarKy0@users.noreply.github.com>
2026-07-25 14:08:17 +00:00

22 lines
609 B
C#

using Content.Shared.Tools.Components;
using Content.Shared.Trigger.Components.Triggers;
namespace Content.Shared.Trigger.Systems;
public sealed class TriggerOnToolUseSystem : TriggerOnXSystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<TriggerOnSimpleToolUsageComponent, SimpleToolDoAfterEvent>(OnToolUse);
}
private void OnToolUse(Entity<TriggerOnSimpleToolUsageComponent> ent, ref SimpleToolDoAfterEvent args)
{
if (args.Cancelled)
return;
Trigger.Trigger(ent.Owner, args.User, ent.Comp.KeyOut);
}
}