fix skins.set_player_skin call with skin name parameter

this fix the homedecor_wardrobe compatibility
This commit is contained in:
Alexander Weber 2022-02-15 14:29:45 +01:00
parent c51905d44b
commit cf712e5b54
1 changed files with 3 additions and 3 deletions

View File

@ -34,7 +34,7 @@ function skins.assign_player_skin(player, skin)
else else
return false return false
end end
return true return true, skin_obj
end end
-- update visuals -- update visuals
@ -53,11 +53,11 @@ end
-- Assign and update - should be used on selection externally -- Assign and update - should be used on selection externally
function skins.set_player_skin(player, skin) function skins.set_player_skin(player, skin)
local success = skins.assign_player_skin(player, skin) local success, skin_obj = skins.assign_player_skin(player, skin)
if success then if success then
skins.get_player_skin(player):set_skin(player) skins.get_player_skin(player):set_skin(player)
skins.update_player_skin(player) skins.update_player_skin(player)
minetest.log("action", player:get_player_name().." set skin to "..skin:get_meta("name")) minetest.log("action", player:get_player_name().." set skin to "..skin_obj:get_meta("name"))
end end
return success return success
end end