Co-authored-by: AJCM-git <60196617+AJCM-git@users.noreply.github.com> Co-authored-by: Visne <39844191+Visne@users.noreply.github.com> Co-authored-by: ElectroJr <leonsfriedrich@gmail.com> Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
29 lines
994 B
C#
29 lines
994 B
C#
using Content.Server.DeviceLinking.Events;
|
|
using Content.Server.DeviceLinking.Systems;
|
|
using Content.Server.Explosion.Components;
|
|
|
|
namespace Content.Server.Explosion.EntitySystems
|
|
{
|
|
public sealed partial class TriggerSystem
|
|
{
|
|
[Dependency] private readonly DeviceLinkSystem _signalSystem = default!;
|
|
private void InitializeSignal()
|
|
{
|
|
SubscribeLocalEvent<TriggerOnSignalComponent,SignalReceivedEvent>(OnSignalReceived);
|
|
SubscribeLocalEvent<TriggerOnSignalComponent,ComponentInit>(OnInit);
|
|
}
|
|
|
|
private void OnSignalReceived(EntityUid uid, TriggerOnSignalComponent component, ref SignalReceivedEvent args)
|
|
{
|
|
if (args.Port != component.Port)
|
|
return;
|
|
|
|
Trigger(uid, args.Trigger);
|
|
}
|
|
private void OnInit(EntityUid uid, TriggerOnSignalComponent component, ComponentInit args)
|
|
{
|
|
_signalSystem.EnsureSinkPorts(uid, component.Port);
|
|
}
|
|
}
|
|
}
|