mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-26 04:21:07 +01:00
Fix mapgen crash if there's unknown nodes
This commit is contained in:
parent
b3829eaf9b
commit
affb984c56
1 changed files with 6 additions and 3 deletions
|
@ -1097,11 +1097,14 @@ local function generate_structures(minp, maxp, seed, biomemap)
|
|||
local ground_y = nil
|
||||
for y = struct_max, struct_min, -1 do
|
||||
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
|
||||
local def = minetest.registered_nodes[checknode.name]
|
||||
if def and def.walkable then
|
||||
ground_y = y
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if ground_y then
|
||||
local p = {x=x,y=ground_y+1,z=z}
|
||||
|
|
Loading…
Reference in a new issue