mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-22 15:33:00 +00:00
8 lines
225 B
Lua
8 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
|