Fix matchstick prediction issues (#31418)

* First commit

* Minor fixes please ymal error begone

* If this fixes it

* Last chance

* How

* Forgot

* First fixes

* Added correct component tags

* Minor cleanup

* Address review!

* Namespace change

* Fix yaml yelling

* Changes

* Update namespace

* Removed the unneeded files
This commit is contained in:
beck-thompson
2025-04-08 14:00:57 -07:00
committed by GitHub
parent 048dcd9eeb
commit 3135b2ab3e
9 changed files with 177 additions and 191 deletions

View File

@@ -0,0 +1,25 @@
using Content.Shared.Storage.EntitySystems;
using Content.Shared.Interaction;
using Content.Shared.IgnitionSource.Components;
namespace Content.Shared.IgnitionSource.EntitySystems;
public sealed class MatchboxSystem : EntitySystem
{
[Dependency] private readonly 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);
}
}