mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-04 23:33:01 +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
|