mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 05:27:38 +03:00
24 lines
707 B
C#
24 lines
707 B
C#
using Content.Shared.Weapons.Ranged.Systems;
|
|
using Content.Shared.Wieldable;
|
|
using Content.Shared.Wieldable.Components;
|
|
|
|
namespace Content.Shared._Goobstation.Weapons.Wielding;
|
|
|
|
public sealed class UnwieldOnShootSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly SharedWieldableSystem _wieldable = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<UnwieldOnShootComponent, GunShotEvent>(OnShoot);
|
|
}
|
|
|
|
private void OnShoot(EntityUid uid, UnwieldOnShootComponent component, ref GunShotEvent args)
|
|
{
|
|
if (TryComp(uid, out WieldableComponent? wieldable))
|
|
_wieldable.TryUnwield(uid, wieldable, args.User);
|
|
}
|
|
}
|