forked from MineClone5/MineClone5
Fix mapgen crash if there's unknown nodes
This commit is contained in:
parent
b3829eaf9b
commit
affb984c56
|
@ -1097,9 +1097,12 @@ local function generate_structures(minp, maxp, seed, biomemap)
|
||||||
local ground_y = nil
|
local ground_y = nil
|
||||||
for y = struct_max, struct_min, -1 do
|
for y = struct_max, struct_min, -1 do
|
||||||
local checknode = minetest.get_node_or_nil({x=x,y=y,z=z})
|
local checknode = minetest.get_node_or_nil({x=x,y=y,z=z})
|
||||||
if checknode and minetest.registered_nodes[checknode.name].walkable then
|
if checknode then
|
||||||
ground_y = y
|
local def = minetest.registered_nodes[checknode.name]
|
||||||
break
|
if def and def.walkable then
|
||||||
|
ground_y = y
|
||||||
|
break
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue