- #define BASE_WORKER_PROD_RATE 15
- #define CARGO1_CALCULATION min (waiting_cargo_1/16, LOAD_TEMP(0x01)/16)
- #define CARGO2_CALCULATION min (waiting_cargo_2/16, LOAD_TEMP(0x01)/16)
- produce(produce_worker_yard2,
- (waiting_cargo_2 == 0) ? 0 : CARGO1_CALCULATION, // input cargo 1, building materials
- CARGO2_CALCULATION, // input cargo 2, food
- 0, // input cargo 3 - not available for worker yard
- // the real logic follows
- (LOAD_TEMP(0x01) < BASE_WORKER_PROD_RATE * 8) ?
- BASE_WORKER_PROD_RATE :
- max (
- CARGO1_CALCULATION +
- CARGO2_CALCULATION, BASE_WORKER_PROD_RATE),
- 0 // do not repeat this process until next 256 ticks
- );
- switch(FEAT_INDUSTRIES, PARENT, produce_worker_yard, STORE_TEMP(population,0x01)) {
- produce_worker_yard2;
- }