Files
Pieter-Jan BriersandGitHub 5168b5f3d4 IoC source gen compatibility (#43863)
* IoC source gen compatibility

Can be merged before or after https://github.com/space-wizards/RobustToolbox/pull/6549 doesn't really matter.

* Missed a spot
2026-05-09 03:29:58 +00:00

26 lines
805 B
C#

using Content.Shared.Storage.EntitySystems;
using Content.Shared.Interaction;
using Content.Shared.IgnitionSource.Components;
namespace Content.Shared.IgnitionSource.EntitySystems;
public sealed partial class MatchboxSystem : EntitySystem
{
[Dependency] private MatchstickSystem _match = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<MatchboxComponent, InteractUsingEvent>(OnInteractUsing, before: [ typeof(SharedStorageSystem) ]);
}
private void OnInteractUsing(Entity<MatchboxComponent> ent, ref InteractUsingEvent args)
{
if (args.Handled || !TryComp<MatchstickComponent>(args.Used, out var matchstick))
return;
args.Handled = _match.TryIgnite((args.Used, matchstick), args.User);
}
}