Files
ss14-wega/Content.Client/Weapons/Ranged/Systems/GunSystem.BasicEntity.cs
mq 4920c9e907 Update (MOST) instances of EntityUid, Component in GunSystem to Entity<T> (#41966)
* Entity<T>, skipping Magazine and ChamberMagazine

* missed some

* AUGH!!

* ballistic examine

* dotnet hates me

* WHY ARE YOU CALLED THAT!!!!

* cheers aada
2026-01-01 19:00:49 +00:00

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