mirror of
https://github.com/minetest/minetest_game.git
synced 2025-01-08 06:30:17 +01:00
Use Minetest's table.insert_all
This commit is contained in:
parent
4b2228066f
commit
224ae80626
@ -225,13 +225,12 @@ end
|
||||
bones.register_dead_player_inv_management(player_dies_transfer_inventory)
|
||||
|
||||
local function collect_all_items(player)
|
||||
local all_inventory = {}
|
||||
local all_items = {}
|
||||
for _, fun in ipairs(dead_player_callbacks) do
|
||||
local items = fun(player)
|
||||
-- https://www.programming-idioms.org/idiom/166/concatenate-two-lists/3812/lua
|
||||
table.move(items, 1, #items, #all_inventory + 1, all_inventory)
|
||||
table.insert_all(all_items, items)
|
||||
end
|
||||
return all_inventory
|
||||
return all_items
|
||||
end
|
||||
|
||||
-- check if it's possible to place bones, if not find space near player
|
||||
|
Loading…
Reference in New Issue
Block a user