mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-12-23 12:05: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
|