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>
This commit is contained in:
imatsoup
2025-05-01 05:35:13 +00:00
committed by GitHub
parent 55ef51a84b
commit d0b1a15309
2 changed files with 5 additions and 1 deletions

View File

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

View File

@@ -44,7 +44,7 @@ public abstract class SharedWieldableSystem : EntitySystem
{
base.Initialize();
SubscribeLocalEvent<WieldableComponent, UseInHandEvent>(OnUseInHand, before: [typeof(SharedGunSystem)]);
SubscribeLocalEvent<WieldableComponent, UseInHandEvent>(OnUseInHand, before: [typeof(SharedGunSystem), typeof(BatteryWeaponFireModesSystem)]);
SubscribeLocalEvent<WieldableComponent, ItemUnwieldedEvent>(OnItemUnwielded);
SubscribeLocalEvent<WieldableComponent, GotUnequippedHandEvent>(OnItemLeaveHand);
SubscribeLocalEvent<WieldableComponent, VirtualItemDeletedEvent>(OnVirtualItemDeleted);