Calculating power usage of buildings with no power
SimplyLiz opened this issue · 0 comments
SimplyLiz commented
In PowerManager, each conductive node is added, represented by coordinates and powerLevel.
So it can happen that there are duplicate entries when a zone and a building on top is added.
For all buildings besides power plants, power production is 0. But should be set to 0.
We should change the way nodes are added.
When something is placed or demolish, check if the mapNode.isConductive() flag is still true, and add or remove it. So we won't have duplicates and don't have to care about what is on the node.
When we calculate power levels, we can then check if the buildings layer is occupied and use power usage -1 then