From d2824c10e75c93adbc1e2df51c49d1ea0e90dcac Mon Sep 17 00:00:00 2001 From: Tim Date: Sun, 16 Aug 2015 17:24:08 +0200 Subject: [PATCH] use the minetest provided table copy function --- homedecor/doors_and_gates.lua | 2 +- homedecor/init.lua | 13 ------------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/homedecor/doors_and_gates.lua b/homedecor/doors_and_gates.lua index 5a51dbf2..08ffeffa 100644 --- a/homedecor/doors_and_gates.lua +++ b/homedecor/doors_and_gates.lua @@ -400,7 +400,7 @@ for i in ipairs(gates_list) do minetest.register_node("homedecor:gate_"..gate.."_closed", def) -- this is either a terrible idea or a great one - def = homedecor.table_copy(def) + def = table.copy(def) def.groups.not_in_creative_inventory = 1 def.selection_box.fixed = { 0.4, -0.5, -0.5, 0.5, 0.5, 0.5 } def.node_box.fixed = gate_models_open[i] diff --git a/homedecor/init.lua b/homedecor/init.lua index b97013b2..d98ca2cc 100644 --- a/homedecor/init.lua +++ b/homedecor/init.lua @@ -19,19 +19,6 @@ homedecor = { expect_infinite_stacks = minetest.setting_getbool("creative_mode") and not minetest.get_modpath("unified_inventory") } ---table copy -function homedecor.table_copy(t) - local nt = { }; - for k, v in pairs(t) do - if type(v) == "table" then - nt[k] = homedecor.table_copy(v) - else - nt[k] = v - end - end - return nt -end - -- Determine if the item being pointed at is the underside of a node (e.g a ceiling) function homedecor.find_ceiling(itemstack, placer, pointed_thing) -- most of this is copied from the rotate-and-place function in builtin