From 2e2d0b49ead4abe88a9252c9a6a503c3560334ed Mon Sep 17 00:00:00 2001 From: AFCMS Date: Thu, 18 Feb 2021 15:07:37 +0000 Subject: [PATCH] performance fix in mcl_skins --- mods/PLAYER/mcl_skins/init.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mods/PLAYER/mcl_skins/init.lua b/mods/PLAYER/mcl_skins/init.lua index b1d1feef8d..0bff9cb184 100644 --- a/mods/PLAYER/mcl_skins/init.lua +++ b/mods/PLAYER/mcl_skins/init.lua @@ -7,6 +7,8 @@ mcl_skins = { } local S = minetest.get_translator("mcl_skins") +local has_mcl_armor = minetest.get_modpath("mcl_armor") +local has_mcl_inventory = minetest.get_modpath("mcl_inventory") -- load skin list and metadata local id, f, data, skin = 0 @@ -105,11 +107,11 @@ mcl_skins.set_player_skin = function(player, skin_id) mcl_skins.previews[playername] = preview player:get_meta():set_string("mcl_skins:skin_id", tostring(skin_id)) mcl_skins.update_player_skin(player) - if minetest.get_modpath("mcl_armor") then + if has_mcl_armor then armor.textures[playername].skin = skin_file armor:update_player_visuals(player) end - if minetest.get_modpath("mcl_inventory") then + if has_mcl_inventory then mcl_inventory.update_inventory_formspec(player) end for i=1, #mcl_skins.registered_on_set_skins do