From 641e79e08429b303071bf37ba2b026e760683cf0 Mon Sep 17 00:00:00 2001 From: Joachim Stolberg Date: Wed, 17 Aug 2022 14:28:55 +0200 Subject: [PATCH] built on 17/08/2022 14:28:55 --- techage/basic_machines/pusher.lua | 3 +++ techage/basis/command.lua | 1 + techage/basis/mark.lua | 2 +- techage/basis/mark2.lua | 2 +- techage/basis/node_states.lua | 7 +++++-- techage/doc/guide.lua | 4 ++-- techage/icta_controller/commands.lua | 10 +++++----- 7 files changed, 18 insertions(+), 11 deletions(-) diff --git a/techage/basic_machines/pusher.lua b/techage/basic_machines/pusher.lua index f9ff656..bc5d147 100644 --- a/techage/basic_machines/pusher.lua +++ b/techage/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/techage/basis/command.lua b/techage/basis/command.lua index e17400e..11246a5 100644 --- a/techage/basis/command.lua +++ b/techage/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/techage/basis/mark.lua b/techage/basis/mark.lua index 9400789..8058b1f 100644 --- a/techage/basis/mark.lua +++ b/techage/basis/mark.lua @@ -82,7 +82,7 @@ minetest.register_entity(":techage:region_cube", { initial_properties = { visual = "upright_sprite", textures = {"techage_cube_mark.png"}, - use_texture_alpha = techage.BLEND, + use_texture_alpha = true, physical = false, glow = 12, }, diff --git a/techage/basis/mark2.lua b/techage/basis/mark2.lua index 449765b..ab1124e 100644 --- a/techage/basis/mark2.lua +++ b/techage/basis/mark2.lua @@ -70,7 +70,7 @@ minetest.register_entity(":techage:position_cube", { "techage_cube_mark.png", "techage_cube_mark.png", }, - use_texture_alpha = techage.BLEND, + use_texture_alpha = true, physical = false, visual_size = {x = 1.1, y = 1.1}, collisionbox = {-0.55,-0.55,-0.55, 0.55,0.55,0.55}, diff --git a/techage/basis/node_states.lua b/techage/basis/node_states.lua index 1b62b35..6febacf 100644 --- a/techage/basis/node_states.lua +++ b/techage/basis/node_states.lua @@ -62,6 +62,8 @@ local P = minetest.string_to_pos local M = minetest.get_meta local N = techage.get_node_lvm +local MAX_CYCLE_TIME = 20 + -- -- TechAge machine states -- @@ -282,6 +284,7 @@ function NodeStates:start(pos, nvm) if self.quick_start and state == STOPPED then self.quick_start(pos, 0) end + self:trigger_state(pos, nvm) return true end return false @@ -468,7 +471,7 @@ function NodeStates:on_receive_message(pos, topic, payload) if node.name == "ignore" then -- unloaded node? return "unloaded" elseif nvm.techage_state == RUNNING then - local ttl = (nvm.last_active or 0) + 2 * (self.cycle_time or 0) + local ttl = (nvm.last_active or 0) + MAX_CYCLE_TIME if ttl < minetest.get_gametime() then return "inactive" end @@ -506,7 +509,7 @@ function NodeStates:on_beduino_request_data(pos, topic, payload) if node.name == "ignore" then -- unloaded node? return 0, {techage.UNLOADED} elseif nvm.techage_state == RUNNING then - local ttl = (nvm.last_active or 0) + 2 * (self.cycle_time or 0) + local ttl = (nvm.last_active or 0) + MAX_CYCLE_TIME if ttl < minetest.get_gametime() then return 0, {techage.INACTIVE} end diff --git a/techage/doc/guide.lua b/techage/doc/guide.lua index 3f5e1a4..c7209f3 100644 --- a/techage/doc/guide.lua +++ b/techage/doc/guide.lua @@ -97,9 +97,9 @@ local function formspec_help(meta, manual) "tableoptions[opendepth=1]".. "table[0.1,0;9,5;page;"..table.concat(aTitel, ",")..";"..idx.."]".. bttn.. + "box[0,5.75;10.775,4.45;#000000]".. "style_type[textarea;textcolor=#FFFFFF]".. - "textarea[0.3,5.7;11,5.3;;"..(aText[idx] or "")..";]".. - "box[0,5.75;10.775,4.45;#000000]" + "textarea[0.3,5.7;11,5.3;;"..(aText[idx] or "")..";]" end local function formspec_plan(meta, manual) diff --git a/techage/icta_controller/commands.lua b/techage/icta_controller/commands.lua index db5c5bc..f6c31f5 100644 --- a/techage/icta_controller/commands.lua +++ b/techage/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,