Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebalance warehouse overflow #343

Open
Nightinggale opened this issue Jan 8, 2020 · 0 comments
Open

Rebalance warehouse overflow #343

Nightinggale opened this issue Jan 8, 2020 · 0 comments
Labels
Code Cleanliness Cleanup code Code Readability Make code easier to read Overhaul Tweak\change\rework an existing feature to improve\enchance it
Milestone

Comments

@Nightinggale
Copy link
Contributor

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.

@Nightinggale Nightinggale added Code Cleanliness Cleanup code Code Readability Make code easier to read Overhaul Tweak\change\rework an existing feature to improve\enchance it labels Jan 8, 2020
@Nightinggale Nightinggale added this to the 2.8 milestone Jan 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Cleanliness Cleanup code Code Readability Make code easier to read Overhaul Tweak\change\rework an existing feature to improve\enchance it
Projects
None yet
Development

No branches or pull requests

1 participant