mirror of
https://github.com/HybridDog/nether-pack.git
synced 2024-12-26 02:30:24 +01:00
Fix get_node vs get_node_or_nil usage
This commit is contained in:
parent
5925dc5606
commit
020ab700ff
@ -58,17 +58,17 @@ end
|
|||||||
|
|
||||||
-- returns nodename if area is generated, else calls generation function
|
-- returns nodename if area is generated, else calls generation function
|
||||||
local function generated_or_generate(pos)
|
local function generated_or_generate(pos)
|
||||||
local name = minetest.get_node(pos).name
|
local node = minetest.get_node_or_nil(pos)
|
||||||
if name ~= "ignore" then
|
if node then
|
||||||
return name
|
return node.name
|
||||||
end
|
end
|
||||||
minetest.get_voxel_manip():read_from_map(pos, pos)
|
minetest.get_voxel_manip():read_from_map(pos, pos)
|
||||||
name = minetest.get_node_or_nil(pos)
|
node = minetest.get_node_or_nil(pos)
|
||||||
if not name then
|
if not node then
|
||||||
minetest.emerge_area(vector.subtract(pos, 80), vector.add(pos, 80))
|
minetest.emerge_area(vector.subtract(pos, 80), vector.add(pos, 80))
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
return name.name
|
return node.name
|
||||||
end
|
end
|
||||||
|
|
||||||
-- where the player appears after dying
|
-- where the player appears after dying
|
||||||
|
Loading…
Reference in New Issue
Block a user