- if (vtype != I_NONE) {
- real = floor(real);
- maxr = floor(maxr);
- real = MIN(999.0, real);
- maxr = MIN(999.0, maxr);
- if (CANT_HAPPEN(real < 0.0))
- real = 0;
- if (CANT_HAPPEN(maxr < 0.0))
- maxr = 0;
- /* production backlog? */
- there = MIN(ITEM_MAX, sect.sct_item[vtype]);
- real = MIN(real, ITEM_MAX - there);
- }
+ scratch_sect = sect;
+ real = prod_output(&scratch_sect, prodeff);
+
+ scratch_sect = sect;
+ for (i = 0; i < MAXPRCON; ++i)
+ scratch_sect.sct_item[pp->p_ctype[i]] = ITEM_MAX;
+ scratch_sect.sct_item[pp->p_type] = 0;
+ maxr = prod_output(&scratch_sect, prodeff);