fix skin list without sort key or name

This commit is contained in:
Alexander Weber 2022-02-16 10:18:30 +01:00
parent cf712e5b54
commit da820d06cb
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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