Files
Delta-v/Content.Shared/Trigger/Systems/SolutionTriggerSystem.cs
T
Princess CheeseballsandPrincess Cheeseballs e59a873ae6 Reduce Triggers Boilerplate. (#41086)
* Push 1

* cleanup + master merge

* launchontrigger

* A crumb of cleanup

---------

Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
2025-12-29 11:39:31 -06:00

20 lines
702 B
C#

using Content.Shared.Trigger.Components.Effects;
using Content.Shared.Chemistry.EntitySystems;
namespace Content.Shared.Trigger.Systems;
public sealed class SolutionTriggerSystem : XOnTriggerSystem<AddSolutionOnTriggerComponent>
{
[Dependency] private readonly SharedSolutionContainerSystem _solutionContainer = default!;
protected override void OnTrigger(Entity<AddSolutionOnTriggerComponent> ent, EntityUid target, ref TriggerEvent args)
{
if (!_solutionContainer.TryGetSolution(target, ent.Comp.Solution, out var solutionRef, out _))
return;
_solutionContainer.AddSolution(solutionRef.Value, ent.Comp.AddedSolution);
args.Handled = true;
}
}