parent
ed3e930117
commit
5768c2a8d4
|
|
@ -41,6 +41,7 @@ public sealed class WieldableSystem : EntitySystem
|
|||
SubscribeLocalEvent<WieldableComponent, GotUnequippedHandEvent>(OnItemLeaveHand);
|
||||
SubscribeLocalEvent<WieldableComponent, VirtualItemDeletedEvent>(OnVirtualItemDeleted);
|
||||
SubscribeLocalEvent<WieldableComponent, GetVerbsEvent<InteractionVerb>>(AddToggleWieldVerb);
|
||||
SubscribeLocalEvent<WieldableComponent, HandDeselectedEvent>(OnDeselectWieldable);
|
||||
|
||||
SubscribeLocalEvent<MeleeRequiresWieldComponent, AttemptMeleeEvent>(OnMeleeAttempt);
|
||||
SubscribeLocalEvent<GunRequiresWieldComponent, ShotAttemptedEvent>(OnShootAttempt);
|
||||
|
|
@ -91,6 +92,14 @@ public sealed class WieldableSystem : EntitySystem
|
|||
_gun.RefreshModifiers(uid);
|
||||
}
|
||||
|
||||
private void OnDeselectWieldable(EntityUid uid, WieldableComponent component, HandDeselectedEvent args)
|
||||
{
|
||||
if (!component.Wielded)
|
||||
return;
|
||||
|
||||
TryUnwield(uid, component, args.User);
|
||||
}
|
||||
|
||||
private void OnGunRefreshModifiers(Entity<GunWieldBonusComponent> bonus, ref GunRefreshModifiersEvent args)
|
||||
{
|
||||
if (TryComp(bonus, out WieldableComponent? wield) &&
|
||||
|
|
|
|||
Loading…
Reference in New Issue