Rebalance warehouse overflow #343
Labels
Code Cleanliness
Cleanup code
Code Readability
Make code easier to read
Overhaul
Tweak\change\rework an existing feature to improve\enchance it
Milestone
When the new warehouse capacity system was added, overflow wasn't really being rewritten for a new setup. Instead the vanilla code was adjusted (hacked?) into working with the new system.
The main difference is that vanilla could overflow with one yield only while WTP overflows with all or no yields. This means WTP introduces the ability to overflow yields you aren't producing and as a result you can let pioneers join for a few turns and then you have 49 tools when they try to leave and you have no way of producing tools.
I would propose taking yield overflow out of the loop in CvCity::doYields. Instead afterwards overflow can be handled if needed where we can make colonies pick yields to discard based on price, if the colony produces them, count, if yield can be used for professions etc.
This will also result in the custom house triggering first and then overflow. Not sharing code for those two events allows cleaner code for both cases. Also there are cases where the custom house will sell enough to make other yields not overflow, but that won't be detected with the current code.
Same as #181, but that one ended up being a long discussion with no specific plans, agreements or anything else.
The text was updated successfully, but these errors were encountered: