Update battery-gun item status when charge changes (#6579)
Co-authored-by: mirrorcult <lunarautomaton6@gmail.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user