take care of aliases and rather use air for unkown nodes than crashing
This commit is contained in:
parent
60104b3a2d
commit
e7e37b4360
12
init.lua
12
init.lua
@ -637,6 +637,18 @@ basic_houses.simple_hut_get_materials = function( data, amount_in_this_mapchunk,
|
||||
end
|
||||
end
|
||||
--]]
|
||||
-- aliases would have no content_id for placement
|
||||
for k, v in pairs(data.materials) do
|
||||
if(v and type(v)=="string") then
|
||||
if(minetest.registered_aliases[v]) then
|
||||
data.materials[k] = minetest.registered_aliases[v]
|
||||
end
|
||||
-- avoid crashes - even if that requires placing air
|
||||
if(not(minetest.registered_nodes[data.materials[k]])) then
|
||||
data.materials[k] = "air"
|
||||
end
|
||||
end
|
||||
end
|
||||
return data;
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user