diff options
Diffstat (limited to 'mesecons_luacontroller')
-rw-r--r-- | mesecons_luacontroller/init.lua | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/mesecons_luacontroller/init.lua b/mesecons_luacontroller/init.lua index f50db1a..d03bed3 100644 --- a/mesecons_luacontroller/init.lua +++ b/mesecons_luacontroller/init.lua @@ -50,11 +50,6 @@ local function update_real_port_states(pos, rule_name, new_state) return end local n = meta:get_int("real_portstates") - 1 - if n < 0 then - mesecon.legacy_update_ports(pos) - n = meta:get_int("real_portstates") - 1 - end - -- Create list of bytes in n local L = {} for i = 1, 4 do L[i] = n % 2 @@ -87,9 +82,6 @@ local function get_real_port_states(pos) local meta = minetest.get_meta(pos) local L = {} local n = meta:get_int("real_portstates") - 1 - if n < 0 then - return mesecon.legacy_update_ports(pos) - end for _, name in ipairs(port_names) do L[name] = ((n % 2) == 1) n = math.floor(n / 2) @@ -107,7 +99,6 @@ local function merge_port_states(ports, vports) } end - local function generate_name(ports) local d = ports.d and 1 or 0 local c = ports.c and 1 or 0 @@ -119,9 +110,9 @@ end local function set_port(pos, rule, state) if state then - mesecon:receptor_on(pos, {rule}) + mesecon.receptor_on(pos, {rule}) else - mesecon:receptor_off(pos, {rule}) + mesecon.receptor_off(pos, {rule}) end end @@ -157,7 +148,7 @@ end ----------------- local function overheat_off(pos) - mesecon:receptor_off(pos, mesecon.rules.flat) + mesecon.receptor_off(pos, mesecon.rules.flat) end @@ -260,7 +251,7 @@ local function create_environment(pos, mem, event) event = event, mem = mem, heat = minetest.get_meta(pos):get_int("heat"), - heat_max = OVERHEAT_MAX, + heat_max = mesecon.setting("overheat_max", 20), print = safe_print, interrupt = get_interrupt(pos), digiline_send = get_digiline_send(pos), @@ -570,7 +561,7 @@ for d = 0, 1 do d = d == 1, }, after_dig_node = function (pos, node) - mesecon:receptor_off(pos, output_rules) + mesecon.receptor_off(pos, output_rules) end, is_luacontroller = true, }) |