Fixed bug with appearance of ammo battery magazine guns (#26009)

fixed
This commit is contained in:
778b
2024-03-13 15:13:12 +04:00
committed by GitHub
parent 49c8193739
commit 63232389ca

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