Trigger Refactor (#39034)
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
using Content.Shared.Trigger.Components.Triggers;
|
||||
using Content.Shared.Weapons.Ranged.Events;
|
||||
|
||||
namespace Content.Shared.Trigger.Systems;
|
||||
public sealed partial class TriggerOnEmptyGunshotSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly TriggerSystem _trigger = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<TriggerOnEmptyGunshotComponent, OnEmptyGunShotEvent>(OnEmptyGunShot);
|
||||
}
|
||||
|
||||
private void OnEmptyGunShot(Entity<TriggerOnEmptyGunshotComponent> ent, ref OnEmptyGunShotEvent args)
|
||||
{
|
||||
_trigger.Trigger(ent.Owner, args.User, ent.Comp.KeyOut);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user