summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesecons_luacontroller/init.lua11
1 files changed, 10 insertions, 1 deletions
diff --git a/mesecons_luacontroller/init.lua b/mesecons_luacontroller/init.lua
index 9a835ac..ff429b8 100644
--- a/mesecons_luacontroller/init.lua
+++ b/mesecons_luacontroller/init.lua
@@ -195,7 +195,8 @@ local create_environment = function(pos, mem, event)
mem = mem,
tostring = tostring,
tonumber = tonumber,
- string = string,
+ string = tablecopy(string),
+ math = tablecopy(math),
event = event}
end
@@ -222,6 +223,14 @@ local do_overheat = function (pos, meta)
end
end
+local tablecopy = function(t)
+ local tnew = {}
+ for key, value in pairs(t) do
+ tnew[key] = value
+ end
+ return tnew
+end
+
local load_memory = function(meta)
return minetest.deserialize(meta:get_string("lc_memory")) or {}
end