mirror of
https://github.com/wega-team/ss14-wega.git
synced 2026-02-14 19:30:01 +01:00
* Entity<T>, skipping Magazine and ChamberMagazine * missed some * AUGH!! * ballistic examine * dotnet hates me * WHY ARE YOU CALLED THAT!!!! * cheers aada
21 lines
690 B
C#
21 lines
690 B
C#
using Content.Shared.Weapons.Ranged.Components;
|
|
|
|
namespace Content.Client.Weapons.Ranged.Systems;
|
|
|
|
public partial class GunSystem
|
|
{
|
|
protected override void InitializeBasicEntity()
|
|
{
|
|
base.InitializeBasicEntity();
|
|
SubscribeLocalEvent<BasicEntityAmmoProviderComponent, UpdateAmmoCounterEvent>(OnBasicEntityAmmoCount);
|
|
}
|
|
|
|
private void OnBasicEntityAmmoCount(Entity<BasicEntityAmmoProviderComponent> ent, ref UpdateAmmoCounterEvent args)
|
|
{
|
|
if (args.Control is DefaultStatusControl control && ent.Comp.Count != null && ent.Comp.Capacity != null)
|
|
{
|
|
control.Update(ent.Comp.Count.Value, ent.Comp.Capacity.Value);
|
|
}
|
|
}
|
|
}
|