Put aromr drops into a single loop, fix #22

This commit is contained in:
Pilcrow182 2015-04-14 18:22:22 -05:00
parent 9da2395586
commit dec92749f9

@ -497,17 +497,10 @@ if ARMOR_DROP == true or ARMOR_DESTROY == true then
local owner = meta:get_string("owner")
local inv = meta:get_inventory()
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
inv:add_item("main", stack)
table.remove(drop, i)
end
end
end
end
end)
end
for _,stack in ipairs(drop) do
else
local obj = minetest.add_item(pos, stack)
if obj then
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