1
0
mirror of https://github.com/minetest-mods/3d_armor.git synced 2024-12-28 19:50:35 +01:00

Merge pull request #23 from Pilcrow182/master

Put aromr drops into a single loop, fix #22
This commit is contained in:
stujones11 2015-04-15 18:57:15 +01:00
commit b3f755f7d7

View File

@ -497,17 +497,10 @@ if ARMOR_DROP == true or ARMOR_DESTROY == true then
local owner = meta:get_string("owner") local owner = meta:get_string("owner")
local inv = meta:get_inventory() local inv = meta:get_inventory()
if name == owner then if name == owner then
for i, stack in ipairs(drop) do for _,stack in ipairs(drop) do
if inv:room_for_item("main", stack) then if inv:room_for_item("main", stack) then
inv:add_item("main", stack) inv:add_item("main", stack)
table.remove(drop, i) else
end
end
end
end
end)
end
for _,stack in ipairs(drop) do
local obj = minetest.add_item(pos, stack) local obj = minetest.add_item(pos, stack)
if obj then if obj then
local x = math.random(1, 5) local x = math.random(1, 5)
@ -522,6 +515,11 @@ if ARMOR_DROP == true or ARMOR_DESTROY == true then
end end
end end
end end
end
end
end)
end
end
end) end)
end end