diff --git a/exp_legacy/module/modules/control/vlayer.lua b/exp_legacy/module/modules/control/vlayer.lua index 644bf1df..754c99ed 100644 --- a/exp_legacy/module/modules/control/vlayer.lua +++ b/exp_legacy/module/modules/control/vlayer.lua @@ -509,19 +509,24 @@ local function handle_circuit_power_load() local processed = {} local pi = 0 local po = 0 + for _, v in pairs(spawn_pole) do local e = game.surfaces[1].find_entity(v.n, v.p) if e and e.valid and e.is_connected_to_electric_network() and e.electric_network_id and (not processed[e.electric_network_id]) then local ens = e.electric_network_statistics + for _, c in pairs(ens.input_counts) do pi = pi + c end + for _, c in pairs(ens.output_counts) do po = po + c end + processed[e.electric_network_id] = true end end + return pi * 10000 / math.max(po, 1) end