From f7805ae2a74f2154e286d1b66efe811dfe168e06 Mon Sep 17 00:00:00 2001 From: PHIDIAS Date: Mon, 24 Feb 2025 18:59:47 +0900 Subject: [PATCH] . --- exp_legacy/module/modules/control/vlayer.lua | 5 +++++ 1 file changed, 5 insertions(+) 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