pmotschmann / Evolve

An incremental game about evolving a civilization
Mozilla Public License 2.0
794 stars 343 forks source link

Fix issue where governor may deconstruct crates/containers into resources #1126

Open yarukishi opened 2 months ago

yarukishi commented 2 months ago

The inequality for the Crate/Container Construction governor task is written incorrectly. Instead of being written to require that "at least 1" item can be built, it is written to require that "at least -1" item can be built. This patch corrects the inequality.

The functions in resources.js to build crates and containers will work "as expected" when the argument is a natural number, but they perform other behaviors when receiving arguments of -1 (delete item and refund resources) or 0 (use key multiplier to build).

Fixes #985.

Tested with the following save file. evolve-2024-04-26-19-40.txt