Files
wwdpublic/Content.Shared/_Goobstation/Weapons/Wielding/UnwieldOnShootSystem.cs
SlamBamActionman bd28f7f0dd Add conditional camera offset based on cursor - Hristov Rework, Part 1 (#31626)
(cherry picked from commit 5c782d30283d5e3661e1ce6ebc6d972f12671c41)
2025-09-20 18:51:05 +03:00

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);
}
}