Extra error checking.

This commit is contained in:
Duane 2016-07-15 02:58:33 -05:00
parent aa999e2ed5
commit bf26b8bee1
25 changed files with 897 additions and 314 deletions

View file

@ -34,7 +34,15 @@ newnode.light_source = 1
newnode.on_construct = nil
newnode.drop = 'default:chest'
newnode.on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
if not (pos and clicker) then
return
end
local meta = minetest.get_meta(pos)
if not meta then
return
end
local ready = meta:get_string('formspec')
if ready == '' then
@ -65,6 +73,10 @@ local pyramid_noise_1 = {offset = 0, scale = 1, seed = -6012, spread = {x = 20,
fun_caves.pyramid = function(minp, maxp, data, p2data, area, biomemap, biome_ids, node, heightmap)
if not (minp and maxp and data and p2data and area and node and type(data) == 'table' and type(p2data) == 'table') then
return
end
if math.random(20) ~= 1 then
return
end
@ -104,6 +116,9 @@ fun_caves.pyramid = function(minp, maxp, data, p2data, area, biomemap, biome_ids
local map_min = {x = minp.x, y = minp.y, z = minp.z}
local pyramid_1 = minetest.get_perlin_map(pyramid_noise_1, map_max):get3dMap_flat(map_min)
if not pyramid_1 then
return
end
local write = true
local p2write = false