From 00360968b74820576a50fbaa75b95b1b25d6160b Mon Sep 17 00:00:00 2001 From: Serylis of Five Date: Wed, 27 Aug 2025 00:26:13 +0200 Subject: [PATCH] Make Modular Grenades with Chemical payload respect their trigger delay (#39905) * adds `KeysIn` data field to `ChemicalPayloadComponent` And check when handling chemical payloads that a trigger key exists. * Update Content.Server/Payload/EntitySystems/PayloadSystem.cs --------- Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com> --- Content.Server/Payload/EntitySystems/PayloadSystem.cs | 4 +++- .../Payload/Components/ChemicalPayloadComponent.cs | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Content.Server/Payload/EntitySystems/PayloadSystem.cs b/Content.Server/Payload/EntitySystems/PayloadSystem.cs index 11e97c5b93..542c3559d5 100644 --- a/Content.Server/Payload/EntitySystems/PayloadSystem.cs +++ b/Content.Server/Payload/EntitySystems/PayloadSystem.cs @@ -150,7 +150,9 @@ public sealed class PayloadSystem : EntitySystem private void HandleChemicalPayloadTrigger(Entity entity, ref TriggerEvent args) { - // TODO: Adjust to the new trigger system + if (args.Key != null && !entity.Comp.KeysIn.Contains(args.Key)) + return; + if (entity.Comp.BeakerSlotA.Item is not EntityUid beakerA || entity.Comp.BeakerSlotB.Item is not EntityUid beakerB || !TryComp(beakerA, out FitsInDispenserComponent? compA) diff --git a/Content.Shared/Payload/Components/ChemicalPayloadComponent.cs b/Content.Shared/Payload/Components/ChemicalPayloadComponent.cs index d00382ee84..3b29d78777 100644 --- a/Content.Shared/Payload/Components/ChemicalPayloadComponent.cs +++ b/Content.Shared/Payload/Components/ChemicalPayloadComponent.cs @@ -1,4 +1,5 @@ using Content.Shared.Containers.ItemSlots; +using Content.Shared.Trigger.Systems; using Robust.Shared.Serialization; namespace Content.Shared.Payload.Components; @@ -14,6 +15,12 @@ public sealed partial class ChemicalPayloadComponent : Component [DataField("beakerSlotB", required: true)] public ItemSlot BeakerSlotB = new(); + + /// + /// The keys that will activate the chemical payload. + /// + [DataField] + public List KeysIn = new() { TriggerSystem.DefaultTriggerKey }; } [Serializable, NetSerializable]