Skip to content

Commit

Permalink
Update ApcSystem.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
CrazyAmphibian committed Jan 2, 2025
1 parent c30267e commit c22ff90
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Content.Server/Power/EntitySystems/ApcSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,11 @@ public void UpdateUIState(EntityUid uid,
return;

var battery = netBat.NetworkBattery;
const int ChargeAccuracy = 5;
//const int ChargeAccuracy = 5;

// TODO: Fix ContentHelpers or make a new one coz this is cooked.
var charge = ContentHelpers.RoundToNearestLevels(battery.CurrentStorage / battery.Capacity, 1.0, 100 / ChargeAccuracy) / 100f * ChargeAccuracy;
//var charge = ContentHelpers.RoundToNearestLevels(battery.CurrentStorage / battery.Capacity, 1.0, 100 / ChargeAccuracy) / 100f * ChargeAccuracy;
float charge = battery.CurrentStorage / battery.Capacity;

var state = new ApcBoundInterfaceState(apc.MainBreakerEnabled,
(int) MathF.Ceiling(battery.CurrentSupply), apc.LastExternalState,
Expand Down

0 comments on commit c22ff90

Please sign in to comment.