]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fixed bug with appearance of ammo battery magazine guns (#26009)
author778b <33431126+778b@users.noreply.github.com>
Wed, 13 Mar 2024 11:13:12 +0000 (15:13 +0400)
committerGitHub <noreply@github.com>
Wed, 13 Mar 2024 11:13:12 +0000 (22:13 +1100)
fixed

Content.Client/Weapons/Ranged/Systems/GunSystem.Magazine.cs

index eaab8401bc92da6c8e6296edb65c2eb9121b6ddf..0df95e4c02e6d351e0e9bf54b8db94af3ba0e295 100644 (file)
@@ -8,6 +8,7 @@ public sealed partial class GunSystem
     {
         base.InitializeMagazine();
         SubscribeLocalEvent<MagazineAmmoProviderComponent, UpdateAmmoCounterEvent>(OnMagazineAmmoUpdate);
+        SubscribeLocalEvent<MagazineAmmoProviderComponent, AmmoCounterControlEvent>(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);
+    }
 }