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

@ -1,5 +1,9 @@
-- Place a small nodebox.
local function small_cube(grid, pos, diameters)
if not (grid and pos and diameters and type(grid) == 'table' and type(diameters) == 'table') then
return
end
local rock = {}
rock[1] = pos.x
@ -83,6 +87,10 @@ minetest.register_node("fun_caves:small_rocks", {
groups = {stone=1, oddly_breakable_by_hand=3, dig_immediate = 3},
sounds = default.node_sound_stone_defaults(),
after_place_node = function(pos, placer, itemstack, pointed_thing)
if not pos then
return
end
minetest.set_node(pos, {name = "fun_caves:small_rocks"..math.random(6)})
end,
})