Fixes two powernet related issues:

- First issue is power monitoring consoles showing slightly inaccurate values. The code calculated some sort of level average which resulted in stupid values being reported (like load 500kW available 300kW). This also fixes APC load partially showing as Other load on the console.
- Second fixed issue (Fixes #7869) resolved gamebreaking bug that caused total irreversible failure of all powernets if makepowernets() was called. This, for example, includes large enough explosions, via admin command, or few other cases.
This commit is contained in:
Atlantiscze
2015-01-20 21:12:52 +01:00
parent c58b2860d4
commit 8dbe6d2f35

View File

@@ -16,9 +16,11 @@
/datum/powernet/New()
powernets += src
..()
/datum/powernet/Del()
powernets -= src
..()
//Returns the amount of excess power (before refunding to SMESs) from last tick.
//This is for machines that might adjust their power consumption using this data.
@@ -110,8 +112,7 @@
S.restore() // and restore some of the power that was used
//updates the viewed load (as seen on power computers)
viewload = 0.8*viewload + 0.2*load
viewload = round(viewload)
viewload = round(load)
//reset the powernet
load = 0