Files
Bubberstation/code/modules/power
SkyratBot 3d3dfdc80a [MIRROR] Cell chargers now pull from the grid's surplus rather than their room's APC cell (#1782)
* Cell chargers now pull from the grid's surplus rather than their room's APC cell (#54989)

About The Pull Request

As the title says.

    Creates a new proc, use_power_from_net() that attempts to pull power from the grid (by adding the amount needed to the APC's powernet load), and returns the amount gathered if there was enough surplus to do so. This bypasses the APC's internal cell for power drawn this way.

    Changes cell chargers to use this new proc for charging a cell. The charger machine still uses some power from the APC, set to 1% of it's max cell charging rate, for machine-related power costs. I'm not deadset on that number, I just needed to start with something. To be clear, this 1% is to simulate running the cell charger's circuitry; all of the power for the cell it's charging is 1-to-1 coming from the powernet.

    This does not subvert the original PR's purpose; cells are still drawing as much power from the grid as they charge with.

Why It's Good For The Game

Fixes cell chargers breaking rooms after the prior cell charger fix. The load is now on the grid, and it being surplus means that it (probably) won't actually powersink anything.

Fixes #54919 by taking a different approach that entirely avoids the issue.

* Cell chargers now pull from the grid's surplus rather than their room's APC cell

Co-authored-by: zxaber <37497534+zxaber@users.noreply.github.com>
2020-11-23 13:34:33 +01:00
..
2020-10-30 17:30:11 +00:00