Fix prod() to limit level production to resource contents

This could make production command mispredict resource-depleting level
production.  Stock game is not affected.  In fact, such a product
would be highly unusual.
This commit is contained in:
Markus Armbruster 2009-09-07 15:18:17 -04:00
parent c63ec06d15
commit 8718a9428a

View file

@ -247,7 +247,7 @@ prod(void)
* workforce?
*/
max = (int)(work * p_e / (double)unit_work + 0.5);
if (resource && pp->p_nrdep != 0 && vtype != I_NONE) {
if (resource && pp->p_nrdep != 0) {
if (*resource * 100 < pp->p_nrdep * max)
max = *resource * 100 / pp->p_nrdep;
}