(prod): Add material limit for resource depletion to prod()

that is in place in the normal update sequence.
This commit is contained in:
Ron Koenderink 2005-12-31 02:42:55 +00:00
parent f7898f41e0
commit 27fe2e7be6

View file

@ -225,6 +225,10 @@ prod(void)
* workforce?
*/
max = (int)(work * p_e / (double)unit_work + 0.5);
if (pp->p_nrdep != 0 && vtype != I_NONE) {
if (*resource * 100 < pp->p_nrdep * max)
max = *resource * 100 / pp->p_nrdep;
}
act = min(used, max);
real = dmin(999.0, (double)act * prodeff);