Automatically sort tree table by ID

master
Wuzzy 2014-10-16 14:15:54 +02:00
parent 7538cc4928
commit 0ae9a78caf
1 changed files with 2 additions and 0 deletions

View File

@ -613,6 +613,7 @@ function ltool.get_tree_ids()
for tree_id, _ in pairs(ltool.trees) do
table.insert(ids, tree_id)
end
table.sort(ids)
return ids
end
@ -898,6 +899,7 @@ function ltool.process_form(player,formname,fields)
ltool.trees[new_tree_id].author = tree.author
ltool.next_tree_id = ltool.next_tree_id + 1
ltool.trees[tree_id] = nil
ltool.playerinfos[playername].dbsel = ltool.number_of_trees
end
end
end