From 10307f23a78b33af50dc4a5f3d1baafb4ee4b0d9 Mon Sep 17 00:00:00 2001 From: Maciej 'agaran' Pijanka <agaran@pld-linux.org> Date: Thu, 16 Mar 2017 00:00:22 +0100 Subject: [PATCH] Do not run converters twice. --- technic/machines/supply_converter.lua | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/technic/machines/supply_converter.lua b/technic/machines/supply_converter.lua index 15c761d..a94b9e2 100644 --- a/technic/machines/supply_converter.lua +++ b/technic/machines/supply_converter.lua @@ -58,13 +58,18 @@ } } -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") local meta = minetest.get_meta(pos) local enabled = meta:get_int("enabled") ~= 0 and (meta:get_int("mesecon_mode") == 0 or meta:get_int("mesecon_effect") ~= 0) - local demand = enabled and meta:get_int("power") or 10000 + local demand = enabled and meta:get_int("power") or 0 local pos_up = {x=pos.x, y=pos.y+1, z=pos.z} local pos_down = {x=pos.x, y=pos.y-1, z=pos.z} -- Gitblit v1.8.0