News:

Simutrans Sites
Know our official sites. Find tools and resources for Simutrans.

[patch] Fix factory consumption

Started by TurfIt, February 06, 2010, 06:59:58 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

TurfIt

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.



prissi