(fuel, load, prod, max_population, shp_nav_one_sector,

nav_loadship, upd_buildeff): Identify BIG_CITY
(IS_BIG_CITY) by using packing type of UPKG instead of
opt_BIG_CITY and sector type of SCT_CAPITAL.
This commit is contained in:
Ron Koenderink 2005-11-14 13:52:12 +00:00
parent d581485d32
commit a2798857cf
8 changed files with 36 additions and 40 deletions

View file

@ -192,7 +192,7 @@ nav_loadship(struct shpstr *sp, natid cnum)
continue;
}
if (sectp->sct_type != SCT_HARBR &&
(!opt_BIG_CITY || sectp->sct_type != SCT_CAPIT)) {
!IS_BIG_CITY(sectp->sct_type)) {
/* we can only load in harbors */
didsomething[i] = 1;
continue;

View file

@ -84,20 +84,18 @@ upd_buildeff(struct natstr *np, struct sctstr *sp, int *workp,
}
neweff = n;
*cost += work_cost;
if (opt_BIG_CITY) {
if (!n && dchr[old_type].d_pkg == UPKG &&
dchr[*desig].d_pkg != UPKG) {
int maxpop = max_population(np->nat_level[NAT_RLEV], *desig, n);
if (vec[I_CIVIL] > maxpop)
vec[I_CIVIL] = maxpop;
if (vec[I_UW] > maxpop)
vec[I_UW] = maxpop;
*workp = (vec[I_CIVIL] * sctwork) / 100.0
+ (vec[I_MILIT] * 2 / 5.0) + vec[I_UW];
*workp = roundavg((etu * (*workp)) / 100.0);
if (!n && IS_BIG_CITY(old_type) &&
!IS_BIG_CITY(*desig)) {
int maxpop = max_population(np->nat_level[NAT_RLEV], *desig, n);
if (vec[I_CIVIL] > maxpop)
vec[I_CIVIL] = maxpop;
if (vec[I_UW] > maxpop)
vec[I_UW] = maxpop;
*workp = (vec[I_CIVIL] * sctwork) / 100.0
+ (vec[I_MILIT] * 2 / 5.0) + vec[I_UW];
*workp = roundavg((etu * (*workp)) / 100.0);
buildeff_work = min((int)(*workp / 2), buildeff_work);
}
buildeff_work = min((int)(*workp / 2), buildeff_work);
}
}
if (np->nat_priorities[*desig]) {