Allow Flares to light cigarettes (#29476)
* Allow Flares to light cigarettes * !IsHot check * nicer looking(and I think the right way to do that...) * heh, whoops * Adds IgnitionEvent, IgnitionSource now functions as IsHot when Ignited * Fixes + remove redundancy * Hows this? * press enter Co-authored-by: ShadowCommander <10494922+ShadowCommander@users.noreply.github.com> * Flare is not forever hot anymore * Formatting fixes * Make IgnitionEvent readonly --------- Co-authored-by: ShadowCommander <10494922+ShadowCommander@users.noreply.github.com>
This commit is contained in:
@@ -19,18 +19,25 @@ public sealed class IgnitionSourceSystem : EntitySystem
|
||||
|
||||
SubscribeLocalEvent<IgnitionSourceComponent, IsHotEvent>(OnIsHot);
|
||||
SubscribeLocalEvent<ItemToggleHotComponent, ItemToggledEvent>(OnItemToggle);
|
||||
SubscribeLocalEvent<IgnitionSourceComponent, IgnitionEvent>(OnIgnitionEvent);
|
||||
}
|
||||
|
||||
private void OnIsHot(Entity<IgnitionSourceComponent> ent, ref IsHotEvent args)
|
||||
{
|
||||
SetIgnited((ent.Owner, ent.Comp), args.IsHot);
|
||||
args.IsHot = ent.Comp.Ignited;
|
||||
}
|
||||
|
||||
private void OnItemToggle(Entity<ItemToggleHotComponent> ent, ref ItemToggledEvent args)
|
||||
{
|
||||
if (TryComp<IgnitionSourceComponent>(ent, out var comp))
|
||||
SetIgnited((ent.Owner, comp), args.Activated);
|
||||
}
|
||||
|
||||
private void OnIgnitionEvent(Entity<IgnitionSourceComponent> ent, ref IgnitionEvent args)
|
||||
{
|
||||
SetIgnited((ent.Owner, ent.Comp), args.Ignite);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Simply sets the ignited field to the ignited param.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user