Decouple power sink from tickrate (#40789)

* Fix typo in `BatterySystem.ChangeCharge`.

* Decouple power sink behavior from tickrate.

* Fix power sink's price per joule
This commit is contained in:
YotaXP
2025-10-10 19:01:33 -04:00
committed by GitHub
parent 21460c86b0
commit 6f02e6c19c
3 changed files with 4 additions and 4 deletions

View File

@@ -66,7 +66,7 @@ namespace Content.Server.PowerSink
if (!transform.Anchored)
continue;
_battery.SetCharge(entity, battery.CurrentCharge + networkLoad.NetworkLoad.ReceivingPower / 1000, battery);
_battery.ChangeCharge(entity, networkLoad.NetworkLoad.ReceivingPower * frameTime, battery);
var currentBatteryThreshold = battery.CurrentCharge / battery.MaxCharge;