mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-26 17:12:59 +00:00
Starbeamrainbowlabs
1f44e240fb
..it was getting rather long, because Lua doesn't exactly come with batteries included :-/
7 lines
225 B
Lua
7 lines
225 B
Lua
--- Returns only the last count items in a given numerical table-based list.
|
|
function worldeditadditions.table_get_last(tbl, count)
|
|
return {worldeditadditions.table_unpack(
|
|
tbl,
|
|
math.max(0, (#tbl) - (count - 1))
|
|
)}
|
|
end
|