Fix reveal node for placeholders.

We were accidentally shadowing `nodes` which broke the texture
retrieval call, but worse, we never searched for placeholder
nodes in the search filter.
This commit is contained in:
Auke Kok 2019-11-08 20:21:35 -08:00
parent 3be634fa58
commit d9b5622049

View File

@ -733,8 +733,8 @@ minetest.register_tool("tools:reveal", {
local limit = 32
local ppos = vector.floor(digger:get_pos())
local nodes = {}
local needle = {"group:axe", "group:shovel", "group:pickaxe", "group:hand"}
local nodeslist = {}
local needle = {"group:axe", "group:shovel", "group:pickaxe", "group:hand", "nodes:placeholder"}
for d = 3, 6 do
if limit > 0 then
local poslist, _ = minetest.find_nodes_in_area(vector.subtract(ppos, d),
@ -745,7 +745,7 @@ minetest.register_tool("tools:reveal", {
if limit > 0 then
if v.x < box.maxp.x and v.y < box.maxp.y and v.z < box.maxp.z and
v.x > box.minp.x and v.y > box.minp.y and v.z > box.minp.z then
nodes[minetest.pos_to_string(v)] = 1
nodeslist[minetest.pos_to_string(v)] = 1
limit = limit - 1
end
end
@ -753,7 +753,7 @@ minetest.register_tool("tools:reveal", {
end
end
for k, _ in pairs(nodes) do
for k, _ in pairs(nodeslist) do
local pos = minetest.string_to_pos(k)
local node = minetest.get_node(pos)
local groups = minetest.registered_nodes[node.name] and