summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Zhang <azhang9@gmail.com>2013-03-15 17:46:59 -0400
committerAnthony Zhang <azhang9@gmail.com>2013-03-15 17:46:59 -0400
commit3c3e45c7ea9fff498274104de7e2cc934c493e5c (patch)
tree8a927d2abcb5b8eb4a20469aef63c385714d6321
parent5fd1cf5c806352b65892d0354e7f1da9be4af59d (diff)
downloadmesecons-3c3e45c7ea9fff498274104de7e2cc934c493e5c.tar
mesecons-3c3e45c7ea9fff498274104de7e2cc934c493e5c.tar.gz
mesecons-3c3e45c7ea9fff498274104de7e2cc934c493e5c.tar.bz2
mesecons-3c3e45c7ea9fff498274104de7e2cc934c493e5c.tar.xz
mesecons-3c3e45c7ea9fff498274104de7e2cc934c493e5c.zip
Avoid corrupting metadata.
-rw-r--r--mesecons_luacontroller/init.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/mesecons_luacontroller/init.lua b/mesecons_luacontroller/init.lua
index a88984b..9a835ac 100644
--- a/mesecons_luacontroller/init.lua
+++ b/mesecons_luacontroller/init.lua
@@ -283,6 +283,7 @@ end
local reset_meta = function(pos, code, errmsg)
local meta = minetest.env:get_meta(pos)
+ meta:set_string("code", code)
if minetest.formspec_escape then
code = minetest.formspec_escape(code or "")
errmsg = minetest.formspec_escape(errmsg or "")
@@ -292,7 +293,6 @@ local reset_meta = function(pos, code, errmsg)
errmsg = string.gsub(errmsg or "", "%[", "(") -- would otherwise
errmsg = string.gsub(errmsg, "%]", ")") -- corrupt formspec
end
- meta:set_string("code", code)
meta:set_string("formspec", "size[10,8]"..
"background[-0.2,-0.25;10.4,8.75;jeija_luac_background.png]"..
"textarea[0.2,0.6;10.2,5;code;;"..code.."]"..