Fixed a minor bug involving nested objects.

This commit is contained in:
rdococ 2017-08-06 20:10:08 +01:00
parent ee9dad9578
commit 01c0ce3c72
1 changed files with 9 additions and 0 deletions

View File

@ -549,6 +549,15 @@ field[value;Value;${value}]
return info
end
end
-- We want to avoid problems like this:
-- serialize({nest = serialize({table})) =/= serialize({nest = {table}})
-- so we automatically deserialize the value if it can be deserialized.
if type(value) == "string" then
local deserialized = minetest.deserialize(value)
if deserialized then value = deserialized end
end
info[propname] = value
return info