From: imatsoup <93290208+imatsoup@users.noreply.github.com> Date: Thu, 1 May 2025 05:35:13 +0000 (+0000) Subject: Fixes battery weapons changing firemode on wield (#37085) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=d0b1a153091dfef836aaa9d26a49e032537f2cf2;p=space-station-14.git Fixes battery weapons changing firemode on wield (#37085) Credit to Happyrobot33 for the implementation Co-authored-by: Matthew Herber <32679887+happyrobot33@users.noreply.github.com> --- diff --git a/Content.Shared/Weapons/Ranged/Systems/BatteryWeaponFireModesSystem.cs b/Content.Shared/Weapons/Ranged/Systems/BatteryWeaponFireModesSystem.cs index 0c90ae1637..974bfa1783 100644 --- a/Content.Shared/Weapons/Ranged/Systems/BatteryWeaponFireModesSystem.cs +++ b/Content.Shared/Weapons/Ranged/Systems/BatteryWeaponFireModesSystem.cs @@ -82,6 +82,10 @@ public sealed class BatteryWeaponFireModesSystem : EntitySystem private void OnUseInHandEvent(EntityUid uid, BatteryWeaponFireModesComponent component, UseInHandEvent args) { + if(args.Handled) + return; + + args.Handled = true; TryCycleFireMode(uid, component, args.User); } diff --git a/Content.Shared/Wieldable/SharedWieldableSystem.cs b/Content.Shared/Wieldable/SharedWieldableSystem.cs index 2e50c655fc..ec476e6db6 100644 --- a/Content.Shared/Wieldable/SharedWieldableSystem.cs +++ b/Content.Shared/Wieldable/SharedWieldableSystem.cs @@ -44,7 +44,7 @@ public abstract class SharedWieldableSystem : EntitySystem { base.Initialize(); - SubscribeLocalEvent(OnUseInHand, before: [typeof(SharedGunSystem)]); + SubscribeLocalEvent(OnUseInHand, before: [typeof(SharedGunSystem), typeof(BatteryWeaponFireModesSystem)]); SubscribeLocalEvent(OnItemUnwielded); SubscribeLocalEvent(OnItemLeaveHand); SubscribeLocalEvent(OnVirtualItemDeleted);