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

@@ -171,7 +171,7 @@ namespace Content.Server.Power.EntitySystems
if (!Resolve(uid, ref battery))
return 0;
var newValue = Math.Clamp(0, battery.CurrentCharge + value, battery.MaxCharge);
var newValue = Math.Clamp(battery.CurrentCharge + value, 0, battery.MaxCharge);
var delta = newValue - battery.CurrentCharge;
battery.CurrentCharge = newValue;