diff --git a/api.lua b/api.lua index 8c88391..b5a8211 100644 --- a/api.lua +++ b/api.lua @@ -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 diff --git a/skinlist.lua b/skinlist.lua index cb8d050..7f8cc2f 100644 --- a/skinlist.lua +++ b/skinlist.lua @@ -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