- i = 0;
- for (j = 0; j < MAXPRCON; ++j) {
- it = pp->p_ctype[j];
- if (it > I_NONE && it <= I_MAX && ichr[it].i_mnem != 0) {
- if (CANT_HAPPEN(i >= 3))
- break;
- sprintf(use[i], "%4d%c",
- (int)((take * (double)pp->p_camt[j]) + 0.5),
- ichr[it].i_mnem);
- sprintf(maxc[i], "%4d%c",
- (int)((mtake * (double)pp->p_camt[j]) + 0.5),
- ichr[it].i_mnem);
- ++i;
- }
- }
- while (i < 3) {
- strcpy(use[i], " ");
- strcpy(maxc[i], " ");
- ++i;
- }
-
- is_enlist:
-
- if (nsect++ == 0) {
- pr("PRODUCTION SIMULATION\n");
- pr(" sect des eff avail make p.e. cost use1 use2 use3 max1 max2 max3 max\n");
- }
-
- prxy("%4d,%-4d", nstr.x, nstr.y, player->cnum);
- pr(" %c", dchr[type].d_mnem);
- pr(" %3.0f%%", p_e * 100.0);
- pr(" %5d", work);
-
- if (vtype != I_NONE) {
- pr(" %4d%c", (int)(real + 0.5), ichr[vtype].i_mnem);
- } else if (type != SCT_ENLIST) {
- switch (pp->p_level) {
- case NAT_TLEV:
- case NAT_RLEV:
- pr(" %5.2f", real);
- break;
- case NAT_ELEV:
- case NAT_HLEV:
- pr(" %4.0f ", real);
- break;
- default:
- CANT_HAPPEN("bad TYPE");
- pr(" ??? ");
- break;
- }
- } else {
- int maxmil;
- int enlisted;
- int civs;
-
- civs = (1.0 + obrate * etu_per_update) * sect.sct_item[I_CIVIL];
- natp = getnatp(sect.sct_own);
- maxpop = max_pop(natp->nat_level[NAT_RLEV], §);
- civs = min(civs, maxpop);
- /* This isn't quite right, since research might
- rise/fall during the update, but it's the best
- we can really do */
- enlisted = 0;
- maxmil = (civs / 2) - sect.sct_item[I_MILIT];
- if (maxmil > 0) {
- enlisted = (etu_per_update
- * (10 + sect.sct_item[I_MILIT])
- * 0.05);
- if (enlisted > maxmil)
- enlisted = maxmil;
- }
- if (enlisted < 0)
- enlisted = 0;
- if (natp->nat_priorities[type] == 0) {
- maxmil = 0;
- }
- pr(" %4d%c 1.00 $%-5d%4dc %4dc %5d\n",
- enlisted, ichr[I_MILIT].i_mnem, enlisted * 3,
- enlisted, enlisted, maxmil);
- continue;
+ for (i = 0; i < MAXPRCON; ++i) {
+ cmnem[i] = cuse[i] = cmax[i] = 0;
+ if (!pp->p_camt[i])
+ continue;
+ it = pp->p_ctype[i];
+ if (CANT_HAPPEN(it <= I_NONE || I_MAX < it))
+ continue;
+ cmnem[i] = ichr[it].i_mnem;
+ cuse[i] = (int)ceil(take * pp->p_camt[i]);
+ cmax[i] = (int)ceil(mtake * pp->p_camt[i]);