mirror of
https://github.com/corvax-team/ss14-wl.git
synced 2026-09-15 14:52:26 +02:00
* 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
26 lines
805 B
C#
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);
|
|
}
|
|
}
|