From 15e021e2ed1a391412e24f8398ef0bf0c14cd231 Mon Sep 17 00:00:00 2001 From: Joachim Stolberg Date: Sun, 19 Mar 2023 11:46:20 +0100 Subject: [PATCH] fix bug with ta3 node_detector and wielded_light nodes --- logic/node_detector.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/logic/node_detector.lua b/logic/node_detector.lua index 25f0db0..d516ba5 100644 --- a/logic/node_detector.lua +++ b/logic/node_detector.lua @@ -37,6 +37,12 @@ local DropdownValues = { [S("added or removed")] = 3, } +local AirLikeBlocks = {"air"} +for i = 1,14 do + -- Add light blocks from the mod "wielded_light" to the air-like blocks + AirLikeBlocks[#AirLikeBlocks + 1] = "wielded_light:" .. i +end + local function formspec(meta, nvm) local numbers = meta:get_string("numbers") or "" local label = S("added")..","..S("removed")..","..S("added or removed") @@ -57,10 +63,10 @@ local function any_node_changed(pos) local param2 = (node.param2 + 2) % 4 nvm.pos1 = logic.dest_pos(pos, param2, {0}) nvm.pos2 = logic.dest_pos(pos, param2, {0,0,0}) - nvm.num = #minetest.find_nodes_in_area(nvm.pos1, nvm.pos2, {"air"}) + nvm.num = #minetest.find_nodes_in_area(nvm.pos1, nvm.pos2, AirLikeBlocks) return false end - local num1 = #minetest.find_nodes_in_area(nvm.pos1, nvm.pos2, {"air"}) + local num1 = #minetest.find_nodes_in_area(nvm.pos1, nvm.pos2, AirLikeBlocks) local num2 = #minetest.find_nodes_in_area(nvm.pos1, nvm.pos2, {"ignore"}) if num2 == 0 and nvm.num ~= num1 then