mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-09-30 08:07:28 +00:00
* full fucking send * ope forgot to remove the EE scripts * fix test * fix shitcode fail * DELTA THAT VALUE IS NULLABLE * whoopsie daysie
31 lines
1.1 KiB
C#
31 lines
1.1 KiB
C#
using Content.Server.Light.Components;
|
|
using Content.Server.Storage.EntitySystems;
|
|
using Content.Shared.Interaction;
|
|
using Content.Shared.Smoking;
|
|
using Content.Shared.Smoking.Components; // Shitmed Change
|
|
|
|
namespace Content.Server.Light.EntitySystems
|
|
{
|
|
public sealed class MatchboxSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly MatchstickSystem _stickSystem = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
SubscribeLocalEvent<MatchboxComponent, InteractUsingEvent>(OnInteractUsing, before: new[] { typeof(StorageSystem) });
|
|
}
|
|
|
|
private void OnInteractUsing(EntityUid uid, MatchboxComponent component, InteractUsingEvent args)
|
|
{
|
|
if (!args.Handled
|
|
&& EntityManager.TryGetComponent(args.Used, out MatchstickComponent? matchstick)
|
|
&& matchstick.CurrentState == SmokableState.Unlit)
|
|
{
|
|
_stickSystem.Ignite((args.Used, matchstick), args.User);
|
|
args.Handled = true;
|
|
}
|
|
}
|
|
}
|
|
}
|