mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03: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
25 lines
805 B
C#
25 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);
|
|
}
|
|
}
|