From 978962412f384b2d54cc77fa7c792abdf20b8f65 Mon Sep 17 00:00:00 2001 From: Sokomine Date: Mon, 9 May 2022 20:16:19 +0200 Subject: [PATCH] allow to provide a specific formspec version manually --- show_fs.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/show_fs.lua b/show_fs.lua index b0ff2da..b64c5a0 100644 --- a/show_fs.lua +++ b/show_fs.lua @@ -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