From 9ccd9d341ffa6fc5c73c42501e92181840cbb930 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20M=C3=BCller?= <34514239+appgurueu@users.noreply.github.com> Date: Tue, 20 Aug 2024 11:49:41 +0200 Subject: [PATCH] Revert empty form name deprecation warnings --- doc/lua_api.md | 3 ++- src/script/lua_api/l_server.cpp | 12 +----------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/doc/lua_api.md b/doc/lua_api.md index 27a9fef96..dde797325 100644 --- a/doc/lua_api.md +++ b/doc/lua_api.md @@ -6463,7 +6463,8 @@ Formspec * `playername`: name of player to show formspec * `formname`: name passed to `on_player_receive_fields` callbacks. It should follow the `"modname:"` naming convention. - `formname` must not be empty. + * `formname` must not be empty, unless you want to reshow + the inventory formspec without updating it for future opens. * `formspec`: formspec to display * `minetest.close_formspec(playername, formname)` * `playername`: name of player to close formspec diff --git a/src/script/lua_api/l_server.cpp b/src/script/lua_api/l_server.cpp index af9a526e0..69f5cf9a0 100644 --- a/src/script/lua_api/l_server.cpp +++ b/src/script/lua_api/l_server.cpp @@ -426,18 +426,8 @@ int ModApiServer::l_show_formspec(lua_State *L) NO_MAP_LOCK_REQUIRED; const char *playername = luaL_checkstring(L, 1); const char *formname = luaL_checkstring(L, 2); - if (*formname == '\0') { - log_deprecated(L, "Deprecated call to `minetest.show_formspec`:" - "`formname` must not be empty"); - } const char *formspec = luaL_checkstring(L, 3); - - if(getServer(L)->showFormspec(playername,formspec,formname)) - { - lua_pushboolean(L, true); - }else{ - lua_pushboolean(L, false); - } + lua_pushboolean(L, getServer(L)->showFormspec(playername,formspec,formname)); return 1; }