From: 778b <33431126+778b@users.noreply.github.com> Date: Wed, 13 Mar 2024 11:13:12 +0000 (+0400) Subject: Fixed bug with appearance of ammo battery magazine guns (#26009) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=63232389ca9a499fb614960ccf9eae9b3d186037;p=space-station-14.git Fixed bug with appearance of ammo battery magazine guns (#26009) fixed --- diff --git a/Content.Client/Weapons/Ranged/Systems/GunSystem.Magazine.cs b/Content.Client/Weapons/Ranged/Systems/GunSystem.Magazine.cs index eaab8401bc..0df95e4c02 100644 --- a/Content.Client/Weapons/Ranged/Systems/GunSystem.Magazine.cs +++ b/Content.Client/Weapons/Ranged/Systems/GunSystem.Magazine.cs @@ -8,6 +8,7 @@ public sealed partial class GunSystem { base.InitializeMagazine(); SubscribeLocalEvent(OnMagazineAmmoUpdate); + SubscribeLocalEvent(OnMagazineControl); } private void OnMagazineAmmoUpdate(EntityUid uid, MagazineAmmoProviderComponent component, UpdateAmmoCounterEvent args) @@ -26,4 +27,12 @@ public sealed partial class GunSystem RaiseLocalEvent(ent.Value, args, false); } + + private void OnMagazineControl(EntityUid uid, MagazineAmmoProviderComponent component, AmmoCounterControlEvent args) + { + var ent = GetMagazineEntity(uid); + if (ent == null) + return; + RaiseLocalEvent(ent.Value, args, false); + } }