summaryrefslogtreecommitdiff
path: root/api.lua
diff options
context:
space:
mode:
authorbell07 <web.alexander@web.de>2018-05-14 19:38:56 +0200
committerGitHub <noreply@github.com>2018-05-14 19:38:56 +0200
commite761999946c623db364d0681c9bcfae90d4d0d6a (patch)
treed6920747b7358451dfb8b674b30fd8d4b37ac9a7 /api.lua
parentb12aefbe4fe768106ee1d1dfac8567dbbcd8c273 (diff)
parente6516d298284b6a64af2bce7c6df5be2ba4eb964 (diff)
Merge pull request #13 from bell07/master
Visual update fixes if skin change externally
Diffstat (limited to 'api.lua')
-rw-r--r--api.lua15
1 files changed, 12 insertions, 3 deletions
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