From e6516d298284b6a64af2bce7c6df5be2ba4eb964 Mon Sep 17 00:00:00 2001 From: Alexander Weber Date: Sun, 13 May 2018 00:37:19 +0200 Subject: Visual update fixes if skin change externally (with and without 3d armor) API updated also --- api.lua | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'api.lua') diff --git a/api.lua b/api.lua index 5cd9821..94b38e0 100644 --- a/api.lua +++ b/api.lua @@ -31,14 +31,23 @@ end -- update visuals function skins.update_player_skin(player) - local skin = skins.get_player_skin(player) - skin:set_skin(player) + if skins.armor_loaded then + -- all needed is wrapped and implemented in 3d_armor mod + armor:set_player_armor(player) + else + -- do updates manually without 3d_armor + skins.get_player_skin(player):apply_skin_to_player(player) + if minetest.global_exists("sfinv") and sfinv.enabled then + sfinv.set_player_inventory_formspec(player) + end + end end --- Assign and update +-- Assign and update - should be used on selection externally function skins.set_player_skin(player, skin) local success = skins.assign_player_skin(player, skin) if success then + skins.get_player_skin(player):set_skin(player) skins.update_player_skin(player) end return success -- cgit v1.2.3