From 5ae111e1faea49f04da2020c61a23dcc45ece615 Mon Sep 17 00:00:00 2001 From: Buckaroo Banzai <39065740+BuckarooBanzay@users.noreply.github.com> Date: Fri, 25 Nov 2022 21:33:34 +0100 Subject: [PATCH] fix unconditional access to `default` global (#16) Co-authored-by: BuckarooBanzay --- api.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/api.lua b/api.lua index ede80e3..20876c1 100644 --- a/api.lua +++ b/api.lua @@ -1,6 +1,7 @@ -- signs_lib api, backported from street_signs local S = signs_lib.S +local has_default_mod = minetest.get_modpath("default") local function get_sign_formspec() end @@ -21,14 +22,14 @@ signs_lib.standard_xoffs = 4 signs_lib.standard_yoffs = 0 signs_lib.standard_cpl = 35 -signs_lib.standard_wood_groups = table.copy(default and minetest.registered_items["default:sign_wall_wood"].groups or {}) +signs_lib.standard_wood_groups = table.copy(has_default_mod and minetest.registered_items["default:sign_wall_wood"].groups or {}) signs_lib.standard_wood_groups.attached_node = nil -signs_lib.standard_steel_groups = table.copy(default and minetest.registered_items["default:sign_wall_steel"].groups or {}) +signs_lib.standard_steel_groups = table.copy(has_default_mod and minetest.registered_items["default:sign_wall_steel"].groups or {}) signs_lib.standard_steel_groups.attached_node = nil -signs_lib.standard_wood_sign_sounds = table.copy(default and minetest.registered_items["default:sign_wall_wood"].sounds or {}) -signs_lib.standard_steel_sign_sounds = table.copy(default and minetest.registered_items["default:sign_wall_steel"].sounds or {}) +signs_lib.standard_wood_sign_sounds = table.copy(has_default_mod and minetest.registered_items["default:sign_wall_wood"].sounds or {}) +signs_lib.standard_steel_sign_sounds = table.copy(has_default_mod and minetest.registered_items["default:sign_wall_steel"].sounds or {}) signs_lib.default_text_scale = {x=10, y=10}