Add support for the alternative drop syntax (#46)

Until now, when the moreblocks node for a node with the alternative drop syntax were registered, the game crashed.
This commit is contained in:
Thomas--S 2016-06-17 21:15:02 +02:00 committed by Auke Kok
parent 30fba0ea40
commit db93277a98
5 changed files with 5 additions and 5 deletions

View File

@ -77,7 +77,7 @@ function stairsplus:register_micro(modname, subname, recipeitem, fields)
def.on_place = minetest.rotate_node
def.groups = stairsplus:prepare_groups(fields.groups)
def.description = desc
if fields.drop then
if fields.drop and not type(fields.drop) == "table" then
def.drop = modname.. ":micro_" ..fields.drop..alternate
end
minetest.register_node(":" ..modname.. ":micro_" ..subname..alternate, def)

View File

@ -77,7 +77,7 @@ function stairsplus:register_panel(modname, subname, recipeitem, fields)
def.on_place = minetest.rotate_node
def.description = desc
def.groups = stairsplus:prepare_groups(fields.groups)
if fields.drop then
if fields.drop and not type(fields.drop) == "table" then
def.drop = modname.. ":panel_" ..fields.drop..alternate
end
minetest.register_node(":" ..modname.. ":panel_" ..subname..alternate, def)

View File

@ -48,7 +48,7 @@ function stairsplus:register_slab(modname, subname, recipeitem, fields)
def.on_place = minetest.rotate_node
def.description = ("%s (%d/16)"):format(desc_base, num)
def.groups = stairsplus:prepare_groups(fields.groups)
if fields.drop then
if fields.drop and not type(fields.drop) == "table" then
def.drop = modname.. ":slab_" .. fields.drop .. alternate
end
minetest.register_node(":" .. modname .. ":slab_" .. subname .. alternate, def)

View File

@ -231,7 +231,7 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields)
def.on_place = minetest.rotate_node
def.description = desc
def.groups = stairsplus:prepare_groups(fields.groups)
if fields.drop then
if fields.drop and not type(fields.drop) == "table" then
def.drop = modname.. ":slope_" ..fields.drop..alternate
end
minetest.register_node(":" ..modname.. ":slope_" ..subname..alternate, def)

View File

@ -117,7 +117,7 @@ function stairsplus:register_stair(modname, subname, recipeitem, fields)
def.on_place = minetest.rotate_node
def.description = desc
def.groups = stairsplus:prepare_groups(fields.groups)
if fields.drop then
if fields.drop and not type(fields.drop) == "table" then
def.drop = modname .. ":stair_" .. fields.drop .. alternate
end
minetest.register_node(":" .. modname .. ":stair_" .. subname .. alternate, def)