From 7376a9ece63f21853fcd677b7b5e07dbc82f01ef Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 7 Mar 2019 18:35:07 +0100 Subject: [PATCH] Don't use legacy default GUI bg if not existing --- easyvend.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/easyvend.lua b/easyvend.lua index a26848b..5413e9d 100644 --- a/easyvend.lua +++ b/easyvend.lua @@ -134,13 +134,14 @@ easyvend.set_formspec = function(pos, player) local number = meta:get_int("number") local cost = meta:get_int("cost") local itemname = meta:get_string("itemname") - local bg = "" + local bg = "" local configmode = meta:get_int("configmode") == 1 - if minetest.get_modpath("default") then - bg = default.gui_bg .. default.gui_bg_img .. default.gui_slots - end + -- Support legacy background from default mod (MT<=0.4.17) + if minetest.get_modpath("default") and default.gui_bg then + bg = default.gui_bg .. default.gui_bg_img .. default.gui_slots + end - local numbertext, costtext, buysellbuttontext + local numbertext, costtext, buysellbuttontext local itemcounttooltip = "Item count (append ā€œsā€ to multiply with maximum stack size)" local buysell = easyvend.buysell(node.name) if buysell == "sell" then