mirror of
https://github.com/minetest-mods/skinsdb.git
synced 2024-12-22 23:40:18 +01:00
fix skin list without sort key or name
This commit is contained in:
parent
cf712e5b54
commit
da820d06cb
2
api.lua
2
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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user