From 4d4355a7412587419d10bef11e64ed48c052b2ce Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Thu, 13 May 2021 15:19:46 +0200 Subject: [PATCH 1/2] Home: Fix error on missing write permission --- api.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/api.lua b/api.lua index 05a34ee..22788ae 100644 --- a/api.lua +++ b/api.lua @@ -177,8 +177,14 @@ load_home() function ui.set_home(player, pos) local player_name = player:get_player_name() ui.home_pos[player_name] = vector.round(pos) + -- save the home data from the table to the file local output = io.open(ui.home_filename, "w") + if not output then + minetest.log("warning", "[unified_inventory] Failed to save file: " + .. ui.home_filename) + return + end for k, v in pairs(ui.home_pos) do output:write(v.x.." "..v.y.." "..v.z.." "..k.."\n") end From afd38e0c731eeaf53933c3039042b6eb1fcf899d Mon Sep 17 00:00:00 2001 From: David Leal Date: Tue, 25 May 2021 12:31:34 -0500 Subject: [PATCH 2/2] Fix LuaCheck warning (#175) --- internal.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal.lua b/internal.lua index 6113300..f4d8b44 100644 --- a/internal.lua +++ b/internal.lua @@ -54,7 +54,7 @@ function ui.get_formspec(player, page) if not pagedef then return "" -- Invalid page name end - + local formspec = { "formspec_version[4]", "size["..ui_peruser.formw..","..ui_peruser.formh.."]",