Remove all obsolete BatteryComponent method calls (#25871)

Removed all obsolete, non-ECS method calls to BatteryComponent
This commit is contained in:
Tayrtahn
2024-03-06 00:34:50 -05:00
committed by GitHub
parent 4228305b12
commit 2935e5bd78
12 changed files with 44 additions and 57 deletions

View File

@@ -7,6 +7,7 @@ using Content.Server.Station.Systems;
using Robust.Shared.Timing;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Content.Server.Power.EntitySystems;
namespace Content.Server.PowerSink
{
@@ -31,6 +32,7 @@ namespace Content.Server.PowerSink
[Dependency] private readonly ExplosionSystem _explosionSystem = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly StationSystem _station = default!;
[Dependency] private readonly BatterySystem _battery = default!;
public override void Initialize()
{
@@ -64,7 +66,7 @@ namespace Content.Server.PowerSink
if (!transform.Anchored)
continue;
battery.CurrentCharge += networkLoad.NetworkLoad.ReceivingPower / 1000;
_battery.SetCharge(entity, battery.CurrentCharge + networkLoad.NetworkLoad.ReceivingPower / 1000, battery);
var currentBatteryThreshold = battery.CurrentCharge / battery.MaxCharge;