From c78ea7eb664bed26a6a18bbe32d1a49ef6692271 Mon Sep 17 00:00:00 2001 From: Joachim Stolberg Date: Tue, 9 Aug 2022 20:27:33 +0200 Subject: [PATCH] Fix ICTA controller bugs --- basic_machines/pusher.lua | 3 +++ basis/command.lua | 1 + icta_controller/commands.lua | 10 +++++----- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/basic_machines/pusher.lua b/basic_machines/pusher.lua index f9ff656..bc5d147 100644 --- a/basic_machines/pusher.lua +++ b/basic_machines/pusher.lua @@ -282,6 +282,9 @@ local tubing = { return CRD(pos).State:on_beduino_receive_cmnd(pos, topic, payload) end end, + on_beduino_request_data = function(pos, src, topic, payload) + return CRD(pos).State:on_beduino_request_data(pos, topic, payload) + end, } local node_name_ta2, node_name_ta3, node_name_ta4 = diff --git a/basis/command.lua b/basis/command.lua index e17400e..11246a5 100644 --- a/basis/command.lua +++ b/basis/command.lua @@ -230,6 +230,7 @@ function techage.add_node(pos, name, is_ta2) local key = minetest.hash_node_position(pos) local num = NumbersToBeRecycled[key] if num then + NodeInfoCache[num] = nil backend.set_nodepos(num, pos) NumbersToBeRecycled[key] = nil return num diff --git a/icta_controller/commands.lua b/icta_controller/commands.lua index db5c5bc..f6c31f5 100644 --- a/icta_controller/commands.lua +++ b/icta_controller/commands.lua @@ -153,7 +153,7 @@ techage.icta_register_condition("input", { return env.input[data.number] end local result = function(val) - return techage.compare(val, tonumber(data.value) or 0, data.operand) + return techage.compare(val, data.value or "invalid", data.operand) end return condition, result end, @@ -196,7 +196,7 @@ techage.icta_register_condition("state", { return techage.send_single(environ.number, data.number, "state") end local result = function(val) - return techage.compare(val, tonumber(data.value) or 0, data.operand) + return techage.compare(val, data.value or "invalid", data.operand) end return condition, result end, @@ -408,7 +408,7 @@ techage.icta_register_condition("chest", { return techage.send_single(environ.number, data.number, "state") end local result = function(val) - return techage.compare(val, tonumber(data.value) or 0, data.operand) + return techage.compare(val, data.value or "invalid", data.operand) end return condition, result end, @@ -449,7 +449,7 @@ techage.icta_register_condition("signaltower", { return techage.send_single(environ.number, data.number, "state") end local result = function(val) - return techage.compare(val, tonumber(data.value) or 0, data.operand) + return techage.compare(val, data.value or "invalid", data.operand) end return condition, result end, @@ -919,7 +919,7 @@ techage.icta_register_condition("get_filter", { return techage.send_single(environ.number, data.number, "port", data.color) end local result = function(val) - return techage.compare(val, tonumber(data.value) or 0, data.operand) + return techage.compare(val, data.value or "invalid", data.operand) end return condition, result end,