From 8dbe6d2f35690fec42923853b5ffbd1c2b70e70c Mon Sep 17 00:00:00 2001 From: Atlantiscze Date: Tue, 20 Jan 2015 21:12:52 +0100 Subject: [PATCH] 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. --- code/modules/power/powernet.dm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/modules/power/powernet.dm b/code/modules/power/powernet.dm index 401cb41af7..791b69e949 100644 --- a/code/modules/power/powernet.dm +++ b/code/modules/power/powernet.dm @@ -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