Skip to content

Commit bfa75a2

Browse files
appgurueuimre84
authored andcommitted
Use Minetest's table.insert_all
1 parent 93637aa commit bfa75a2

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

mods/bones/init.lua

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,13 +246,12 @@ end
246246
bones.register_dead_player_inv_management(player_dies_transfer_inventory)
247247

248248
local function collect_all_items(player)
249-
local all_inventory = {}
249+
local all_items = {}
250250
for _, fun in ipairs(dead_player_callbacks) do
251251
local items = fun(player)
252-
-- https://www.programming-idioms.org/idiom/166/concatenate-two-lists/3812/lua
253-
table.move(items, 1, #items, #all_inventory + 1, all_inventory)
252+
table.insert_all(all_items, items)
254253
end
255-
return all_inventory
254+
return all_items
256255
end
257256

258257
-- check if it's possible to place bones, if not find space near player

0 commit comments

Comments
 (0)