1
0
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:
Lars Müller 2023-05-29 20:16:01 +02:00 committed by Imre Péntek
parent 4b2228066f
commit 224ae80626

View File

@ -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