mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user