Disallow real_coordinates (as it doesn't work)

This commit is contained in:
luk3yx 2020-12-04 18:17:07 +13:00
parent adfc9d3ef8
commit e81803ec97
2 changed files with 12 additions and 8 deletions

View File

@ -116,7 +116,7 @@ function fixers.list(elem, next_elem)
end
-- Convert the base element to a container
for k, v in pairs(elem) do
for k, _ in pairs(elem) do
if type(k) ~= 'number' and k ~= 'x' and k ~= 'y' then
elem[k] = nil
end
@ -192,10 +192,10 @@ function fs51.backport_string(formspec)
end
-- DEBUG
if not minetest then
function b(fs)
local tree, err = formspec_ast.parse(fs)
if not tree then return tree, err end
return formspec_ast.unparse(formspec_ast.backport(tree))
end
end
-- if not minetest then
-- function b(fs)
-- local tree, err = formspec_ast.parse(fs)
-- if not tree then return tree, err end
-- return formspec_ast.unparse(formspec_ast.backport(tree))
-- end
-- end

View File

@ -301,6 +301,10 @@ function renderer.render_ast(tree, callbacks, options)
end
for _, node in ipairs(formspec_ast.flatten(tree)) do
if node.type == 'real_coordinates' then
return nil, 'Unsupported element: real_coordinates[]'
end
-- Attempt to use a generic renderer
local render_func = elems[node.type] or generic_render