diff options
author | Och Noe <och_noe@forksworld.de> | 2020-02-17 00:05:04 +0100 |
---|---|---|
committer | Och Noe <och_noe@forksworld.de> | 2020-02-17 00:05:04 +0100 |
commit | c0a3d5cfa7717d46168694f3a904fe7e1ce553d2 (patch) | |
tree | d8b1d9fede8dab913e751d43e36c035787495f82 | |
parent | 51509e9f0a476727c74d814c67d63fb621a45a2e (diff) | |
download | moreblocks-c0a3d5cfa7717d46168694f3a904fe7e1ce553d2.tar.gz moreblocks-c0a3d5cfa7717d46168694f3a904fe7e1ce553d2.tar.bz2 moreblocks-c0a3d5cfa7717d46168694f3a904fe7e1ce553d2.zip |
fixed problem
-rw-r--r-- | nodes.lua | 22 |
1 files changed, 20 insertions, 2 deletions
@@ -105,8 +105,26 @@ local minimal_slopes_defs = { } + +local function copytable(orig) + local orig_type = type(orig) + local copy + if orig_type == 'table' then + copy = {} + for orig_key, orig_value in next, orig, nil do + copy[copytable(orig_key)] = copytable(orig_value) + end + setmetatable(copy, copytable(getmetatable(orig))) + else + copy = orig + end + return copy +end + + + local function register_minimal_shapes(modname, subname, recipeitem, fields) - local defs = minimal_slopes_defs + local defs = copytable(minimal_slopes_defs) local desc = S("%s Slope"):format(fields.description) for alternate, def in pairs(defs) do for k, v in pairs(fields) do @@ -118,7 +136,7 @@ local function register_minimal_shapes(modname, subname, recipeitem, fields) def.on_place = minetest.rotate_node def.description = desc def.use_texture_alpha = fields.use_texture_alpha - def.groups = stairsplus:prepare_groups(fields.groups) + def.groups = def.groups -- stairsplus:prepare_groups(fields.groups) if fields.drop and not (type(fields.drop) == "table") then def.drop = modname.. ":slope_" ..fields.drop..alternate end |