Skip to main content
Topic: [patch] Fix factory consumption (Read 2086 times) previous topic - next topic

[patch] Fix factory consumption

Currently factories displaying empty input stores continue to produce at 1 internal production unit when the input store that's empty has a consumption factor < 100%. Power also continues to be consumed in this case.

The input store is not actually empty, but stuck itself at 1 internal unit due to a loss of precision in the routine that decreases the store. (int) 1*factor>>8 = 0 for factors < 256 with 256 being 100%.

This patch ensures the input store reaches 0.

An example industry exhibiting this behaviour is the pak128 1.4.5 Goods Factory. Inputs are plastic@110%, steel@80%, and planks@45%. If plastic runs out, production stops, power consumption stops. If steel or planks run out, the factory continues as per above.



 

Re: [patch] Fix factory consumption

Reply #1
Thanks, incorporated.