From e0eb4c0beae03c84b47b4469dde2db29e1c9bf3d Mon Sep 17 00:00:00 2001 From: Alexsandro Percy Date: Sat, 5 Oct 2024 14:22:43 -0300 Subject: [PATCH] more elegant way to check for a global --- pilot_skin_manager.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pilot_skin_manager.lua b/pilot_skin_manager.lua index 84b0f04..bdcca30 100644 --- a/pilot_skin_manager.lua +++ b/pilot_skin_manager.lua @@ -97,11 +97,11 @@ function airutils.set_player_skin(player, skin) else --remove texture local old_texture = player_meta:get_string("backup") - if set_skin then --checking if set_skin is available (not using an optional dependency, just checking if it exists) + if minetest.global_exists(set_skin) then --checking if set_skin is available if player:get_attribute("set_skin:player_skin") ~= nil and player:get_attribute("set_skin:player_skin") ~= "" then old_texture = player:get_attribute("set_skin:player_skin") end - elseif wardrobe then --checking if wardrobe is available (not using an optional dependency, just checking if it exists) + elseif minetest.global_exists(wardrobe) then --checking if wardrobe is available if wardrobe.playerSkins then if wardrobe.playerSkins[name] ~= nil then old_texture = wardrobe.playerSkins[name]