With etu_per_update large and resource depletion quick, a sector can
produce more work than is required to fully deplete a mine. In that
case, produce() and prod() limit production to what is actually in the
ground. Except produce() got it wrong for sector types with
production efficiency other than 100%.
This affects mountains in the stock game, but only with impractically
large etu_per_update.
worker_limit = roundavg(work * p_e / unit_work);
if (material_consume > worker_limit)
material_consume = worker_limit;
+ if (product->p_nrdep != 0) {
+ if (*resource * 100 < product->p_nrdep * material_consume)
+ material_consume = *resource * 100 / product->p_nrdep;
+ }
if (material_consume == 0)
return 0;
prodeff = prod_eff(desig, np->nat_level[product->p_nlndx]);
actual = roundavg(output);
if (actual <= 0)
return 0;
- if (product->p_nrdep != 0) {
- if (*resource * 100 < product->p_nrdep * actual)
- actual = *resource * 100 / product->p_nrdep;
- }
if (actual > 999) {
material_consume = roundavg(999.0 * material_consume / actual);
actual = 999;