mirror of
https://github.com/minetest-mods/technic.git
synced 2024-11-10 20:40:27 +01:00
Do not run converters twice.
This commit is contained in:
parent
ae7625d9f7
commit
f34edc7deb
|
@ -58,7 +58,12 @@ local mesecons = {
|
|||
}
|
||||
}
|
||||
|
||||
local run = function(pos, node)
|
||||
local run = function(pos, node, run_stage)
|
||||
-- run only in producer stage.
|
||||
if run_stage == technic.receiver then
|
||||
return
|
||||
end
|
||||
|
||||
local remain = 0.9
|
||||
-- Machine information
|
||||
local machine_name = S("Supply Converter")
|
||||
|
|
|
@ -218,7 +218,7 @@ minetest.register_abm({
|
|||
end
|
||||
|
||||
-- Run all the nodes
|
||||
local function run_nodes(list)
|
||||
local function run_nodes(list, run_stage)
|
||||
for _, pos2 in ipairs(list) do
|
||||
technic.get_or_load_node(pos2)
|
||||
local node2 = minetest.get_node(pos2)
|
||||
|
@ -227,14 +227,14 @@ minetest.register_abm({
|
|||
nodedef = minetest.registered_nodes[node2.name]
|
||||
end
|
||||
if nodedef and nodedef.technic_run then
|
||||
nodedef.technic_run(pos2, node2)
|
||||
nodedef.technic_run(pos2, node2, run_stage)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
run_nodes(PR_nodes)
|
||||
run_nodes(RE_nodes)
|
||||
run_nodes(BA_nodes)
|
||||
run_nodes(PR_nodes, technic.producer)
|
||||
run_nodes(RE_nodes, technic.receiver)
|
||||
run_nodes(BA_nodes, technic.battery)
|
||||
|
||||
-- Strings for the meta data
|
||||
local eu_demand_str = tier.."_EU_demand"
|
||||
|
|
Loading…
Reference in New Issue
Block a user