allow to provide a specific formspec version manually

This commit is contained in:
Sokomine 2022-05-09 20:16:19 +02:00
parent bb399d3381
commit 978962412f

View File

@ -86,6 +86,11 @@ end)
-- show formspec with highest possible version information for the player
-- force_version: optional parameter
yl_speak_up.show_fs_ver = function(pname, formname, formspec, force_version)
-- if the formspec already calls for a specific formspec version: use that one
if(string.sub(formspec, 1, 17) == "formspec_version[") then
minetest.show_formspec(pname, formname, formspec)
return
end
local fs_ver = (yl_speak_up.fs_version[pname] or "2")
if(force_version) then
fs_ver = force_version