diff --git a/automobiles_lib/inventory_management.lua b/automobiles_lib/inventory_management.lua index 6e25b98..f3fc75b 100644 --- a/automobiles_lib/inventory_management.lua +++ b/automobiles_lib/inventory_management.lua @@ -92,9 +92,12 @@ function automobiles_lib.remove_inventory(self) if inv_content then local pos = self.object:get_pos() for k, v in pairs(inv_content) do + local count = 0 for i = 0,v:get_count()-1,1 do minetest.add_item({x=pos.x+math.random()-0.5,y=pos.y,z=pos.z+math.random()-0.5},v:get_name()) + count = count + 1 + if count >= 5 then break end end end end