Files
Delta-v/Content.Shared/Trigger/Systems/TriggerOnRotSystem.cs
T
blueDev2andArtisticRoomba 911a137303 Add TriggerOnRot Component (#42667)
* Add TriggerOnRot Component, and related systems and events

* Move around components and events to proper namespaces

* Improve TriggerOnRotComponent Comment

* fix a bunch of imports

* Change BeginRottingEvent to a ByRefEvent record

---------

Co-authored-by: ArtisticRoomba <145879011+ArtisticRoomba@users.noreply.github.com>
2026-06-29 12:43:55 +02:00

20 lines
532 B
C#

using Content.Shared.Atmos.Rotting;
using Content.Shared.Trigger.Components.Triggers;
namespace Content.Shared.Trigger.Systems;
public sealed partial class TriggerOnRotSystem : TriggerOnXSystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<TriggerOnRotComponent, BeginRottingEvent>(OnRot);
}
private void OnRot(Entity<TriggerOnRotComponent> ent, ref BeginRottingEvent args)
{
Trigger.Trigger(ent.Owner, null, ent.Comp.KeyOut, predicted: false);
}
}