pmotschmann / Evolve

An incremental game about evolving a civilization
Mozilla Public License 2.0
824 stars 354 forks source link

Building new factory reduces Nano Tube production when not enough electricity is available #1038

Open daniel-sch opened 7 months ago

daniel-sch commented 7 months ago

When a new Factory is built without enough electricity to power it, the Alloy production will increase by 1, while the Nano Tube production goes down by 1. The expected outcome is that nothing changes, because the new factory is not enabled.

yarukishi commented 7 months ago

Fixed as part of PR #1010 (which also includes a new feature). The check to decide whether enough power is available for a new struct erroneously returns true when it should return false. This causes a powered-off new factory to increment alloy manufacturing. Then, the game loop disables factories from bottom to top until excess production is eliminated.