21 lines
642 B
C#
21 lines
642 B
C#
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);
|
|
}
|
|
}
|