Update battery-gun item status when charge changes (#6579)

Co-authored-by: mirrorcult <lunarautomaton6@gmail.com>
This commit is contained in:
Leon Friedrich
2022-02-16 19:57:16 +13:00
committed by GitHub
parent f88cbbac11
commit 4dfcacb86a
5 changed files with 34 additions and 73 deletions

View File

@@ -1,12 +1,8 @@
using System;
using Content.Server.PowerCell;
using Content.Server.Projectiles.Components;
using Content.Server.Weapon.Ranged.Barrels.Components;
using Content.Shared.PowerCell.Components;
using Content.Shared.Weapons.Ranged.Barrels.Components;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Map;
namespace Content.Server.Weapon.Ranged;
@@ -28,15 +24,6 @@ public sealed partial class GunSystem
UpdateBatteryAppearance(component);
}
private void OnBatteryGetState(EntityUid uid, BatteryBarrelComponent component, ref ComponentGetState args)
{
(int, int)? count = (component.ShotsLeft, component.Capacity);
args.State = new BatteryBarrelComponentState(
component.FireRateSelector,
count);
}
private void OnCellSlotUpdated(EntityUid uid, BatteryBarrelComponent component, PowerCellChangedEvent args)
{
UpdateBatteryAppearance(component);