From 5dadd5c2c34a576fd526045cf7208e23cc9ab6c4 Mon Sep 17 00:00:00 2001 From: crabman77 Date: Wed, 15 Jul 2015 02:59:34 +0200 Subject: [PATCH] Fixed crash when player leave during the join server --- README.txt | 2 +- init.lua | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.txt b/README.txt index 8566052..76745d6 100644 --- a/README.txt +++ b/README.txt @@ -1,6 +1,6 @@ Minetest mod "Inventory Tweaks" =============================== -version: 2.0 +version: 2.0.1 License of source code: WTFPL ----------------------------- diff --git a/init.lua b/init.lua index 0a5583a..b022be1 100644 --- a/init.lua +++ b/init.lua @@ -34,6 +34,9 @@ local function add_buttons(player, formspec) formspec = player:get_inventory_formspec() end local w,h = get_formspec_size(formspec) + if not w or not h then + return + end for i=1,#tweak.buttons do formspec = formspec .. "button["..w-2+(i*0.5)..",-0.2;" .. tweak.buttons[i] end