From 224ae80626f6122186160a5b7ad177782b8bbe6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20M=C3=BCller?= <34514239+appgurueu@users.noreply.github.com> Date: Mon, 29 May 2023 20:16:01 +0200 Subject: [PATCH] Use Minetest's `table.insert_all` --- mods/bones/init.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mods/bones/init.lua b/mods/bones/init.lua index db98da18..a076a905 100644 --- a/mods/bones/init.lua +++ b/mods/bones/init.lua @@ -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