Skip to content

Commit

Permalink
fix skin list without sort key or name
Browse files Browse the repository at this point in the history
  • Loading branch information
bell07 committed Feb 16, 2022
1 parent cf712e5 commit da820d0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api.lua
Expand Up @@ -57,7 +57,7 @@ function skins.set_player_skin(player, skin)
if success then
skins.get_player_skin(player):set_skin(player)
skins.update_player_skin(player)
minetest.log("action", player:get_player_name().." set skin to "..skin_obj:get_meta("name"))
minetest.log("action", player:get_player_name().." set skin to "..skin_obj:get_key(""))
end
return success
end
Expand Down
4 changes: 2 additions & 2 deletions skinlist.lua
Expand Up @@ -73,9 +73,9 @@ local function skins_sort(skinslist)
local a_id = a:get_meta("_sort_id") or 10000
local b_id = b:get_meta("_sort_id") or 10000
if a_id ~= b_id then
return a:get_meta("_sort_id") < b:get_meta("_sort_id")
return a_id < b_id
else
return a:get_meta("name") < b:get_meta("name")
return (a:get_meta("name") or 'ZZ') < (b:get_meta("name") or 'ZZ')
end
end)
end
Expand Down

0 comments on commit da820d0

Please sign in to comment.