mirror of
https://github.com/mt-mods/homedecor_modpack.git
synced 2025-07-08 01:20:23 +02:00
Move table copy function out of signs lib and into init.lua, make it global.
This commit is contained in:
18
init.lua
18
init.lua
@ -29,18 +29,36 @@ else
|
||||
end
|
||||
homedecor.gettext = S
|
||||
|
||||
-- debug
|
||||
|
||||
local dbg = function(s)
|
||||
if homedecor.debug == 1 then
|
||||
print('[HomeDecor] ' .. s)
|
||||
end
|
||||
end
|
||||
|
||||
-- infinite stacks
|
||||
|
||||
if minetest.get_modpath("unified_inventory") or not minetest.setting_getbool("creative_mode") then
|
||||
homedecor.expect_infinite_stacks = false
|
||||
else
|
||||
homedecor.expect_infinite_stacks = true
|
||||
end
|
||||
|
||||
--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
|
||||
|
||||
dofile(homedecor.modpath.."/ownership.lua")
|
||||
dofile(homedecor.modpath.."/lib_6d.lua")
|
||||
|
||||
|
Reference in New Issue
Block a user