From 3c3e45c7ea9fff498274104de7e2cc934c493e5c Mon Sep 17 00:00:00 2001
From: Anthony Zhang <azhang9@gmail.com>
Date: Fri, 15 Mar 2013 17:46:59 -0400
Subject: Avoid corrupting metadata.

---
 mesecons_luacontroller/init.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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.."]"..
-- 
cgit v1.2.3