Fix 'controller will not start' bug

This commit is contained in:
Joachim Stolberg 2022-01-30 11:31:58 +01:00
parent c60b242c5d
commit 7281ec7af7
2 changed files with 12 additions and 0 deletions

View File

@ -244,6 +244,17 @@ function techage.add_to_set(set, x)
end end
end end
-- techage.tbl_filter({"a", "b", "c", "d"}, function(v, k, t) return v >= "c" end) --> {"c","d"}
techage.tbl_filter = function(t, filterIter)
local out = {}
for k, v in pairs(t) do
if filterIter(v, k, t) then out[k] = v end
end
return out
end
function techage.get_node_lvm(pos) function techage.get_node_lvm(pos)
local node = minetest.get_node_or_nil(pos) local node = minetest.get_node_or_nil(pos)
if node then if node then

View File

@ -46,6 +46,7 @@ local function count_trues(t)
end end
local function nucleus(t) local function nucleus(t)
t = techage.tbl_filter(t, function(v, k, t) return type(v) == "table" end)
if #t == 4 then if #t == 4 then
if vector.equals(t[1], t[2]) and vector.equals(t[3], t[4]) then if vector.equals(t[1], t[2]) and vector.equals(t[3], t[4]) then
return true return true