Trigger Refactor (#39034)

This commit is contained in:
slarticodefast
2025-08-03 21:20:37 +02:00
committed by GitHub
parent 777e89ab3e
commit 2c40a950f7
256 changed files with 3987 additions and 2892 deletions

View File

@@ -1,10 +1,10 @@
using Content.Server.Administration.Logs;
using Content.Server.Explosion.EntitySystems;
using Content.Shared.Chemistry.Components;
using Content.Shared.Database;
using Content.Shared.Examine;
using Content.Shared.Payload.Components;
using Content.Shared.Tag;
using Content.Shared.Trigger;
using Content.Shared.Chemistry.EntitySystems;
using Robust.Shared.Containers;
using Robust.Shared.Serialization.Manager;
@@ -54,18 +54,22 @@ public sealed class PayloadSystem : EntitySystem
private void OnCaseTriggered(EntityUid uid, PayloadCaseComponent component, TriggerEvent args)
{
// TODO: Adjust to the new trigger system
if (!TryComp(uid, out ContainerManagerComponent? contMan))
return;
// Pass trigger event onto all contained payloads. Payload capacity configurable by construction graphs.
foreach (var ent in GetAllPayloads(uid, contMan))
{
RaiseLocalEvent(ent, args, false);
RaiseLocalEvent(ent, ref args, false);
}
}
private void OnTriggerTriggered(EntityUid uid, PayloadTriggerComponent component, TriggerEvent args)
{
// TODO: Adjust to the new trigger system
if (!component.Active)
return;
@@ -75,7 +79,7 @@ public sealed class PayloadSystem : EntitySystem
// Ensure we don't enter a trigger-loop
DebugTools.Assert(!_tagSystem.HasTag(uid, PayloadTag));
RaiseLocalEvent(parent, args, false);
RaiseLocalEvent(parent, ref args);
}
private void OnEntityInserted(EntityUid uid, PayloadCaseComponent _, EntInsertedIntoContainerMessage args)
@@ -146,6 +150,7 @@ public sealed class PayloadSystem : EntitySystem
private void HandleChemicalPayloadTrigger(Entity<ChemicalPayloadComponent> entity, ref TriggerEvent args)
{
// TODO: Adjust to the new trigger system
if (entity.Comp.BeakerSlotA.Item is not EntityUid beakerA
|| entity.Comp.BeakerSlotB.Item is not EntityUid beakerB
|| !TryComp(beakerA, out FitsInDispenserComponent? compA)