68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
...
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
for _,v in pairs(checked) do
if vector.equals(pos,v) then return true end
end
return false
end
local i,stack = 1,{startpoint} repeat
local pos = stack[i]
local n = minetest.get_node(pos).name
if n == 'ignore' then
minetest.load_area(pos)
n = minetest.get_node(pos).name
end
if sorcery.lib.tbl.has(names, n) then -- match found
-- record the find
nodes[pos] = n
if positions[n] then positions[n][#positions[n]] = pos
else positions[n] = {pos} end
-- check selected neighbors to see if any need scanning
for _,d in pairs(directions) do
................................................................................
end
fn(sum, n)
end
end;
force = function(pos,preload_for)
local n = minetest.get_node_or_nil(pos)
if n then return n end
if preload_for then
sorcery.lib.node.preload(pos,preload_for)
else
minetest.load_area(pos)
end
return minetest.get_node(pos)
end;
-- when items have already been removed; notify cannot be relied on
-- to reach the entire network; this function accounts for the gap
notifyneighbors = function(pos)
sorcery.lib.node.forneighbor(pos, sorcery.ley.txofs, function(pos,node)
|
|
|
|
<
<
|
>
<
<
<
>
|
<
|
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
...
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
|
for _,v in pairs(checked) do
if vector.equals(pos,v) then return true end
end
return false
end
local i,stack = 1,{startpoint} repeat
local pos = stack[i]
local n = sorcery.lib.node.force(pos).name
if sorcery.lib.tbl.has(names, n, function(check,against)
return sorcery.lib.item.groupmatch(against,check)
end) then -- match found
-- record the find
nodes[pos] = n
if positions[n] then positions[n][#positions[n]] = pos
else positions[n] = {pos} end
-- check selected neighbors to see if any need scanning
for _,d in pairs(directions) do
................................................................................
end
fn(sum, n)
end
end;
force = function(pos,preload_for)
local n = minetest.get_node_or_nil(pos)
if preload_for then sorcery.lib.node.preload(pos,preload_for) end
if n then return n end
minetest.load_area(pos)
return minetest.get_node(pos)
end;
-- when items have already been removed; notify cannot be relied on
-- to reach the entire network; this function accounts for the gap
notifyneighbors = function(pos)
sorcery.lib.node.forneighbor(pos, sorcery.ley.txofs, function(pos,node)
|