mirror of
https://github.com/luanti-org/minetest_game.git
synced 2025-07-04 13:47:12 -04:00
Use Minetest's table.insert_all
This commit is contained in:
parent
93637aab70
commit
bfa75a2a83
1 changed files with 3 additions and 4 deletions
|
@ -246,13 +246,12 @@ end
|
||||||
bones.register_dead_player_inv_management(player_dies_transfer_inventory)
|
bones.register_dead_player_inv_management(player_dies_transfer_inventory)
|
||||||
|
|
||||||
local function collect_all_items(player)
|
local function collect_all_items(player)
|
||||||
local all_inventory = {}
|
local all_items = {}
|
||||||
for _, fun in ipairs(dead_player_callbacks) do
|
for _, fun in ipairs(dead_player_callbacks) do
|
||||||
local items = fun(player)
|
local items = fun(player)
|
||||||
-- https://www.programming-idioms.org/idiom/166/concatenate-two-lists/3812/lua
|
table.insert_all(all_items, items)
|
||||||
table.move(items, 1, #items, #all_inventory + 1, all_inventory)
|
|
||||||
end
|
end
|
||||||
return all_inventory
|
return all_items
|
||||||
end
|
end
|
||||||
|
|
||||||
-- check if it's possible to place bones, if not find space near player
|
-- check if it's possible to place bones, if not find space near player
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue