-
Notifications
You must be signed in to change notification settings - Fork 154
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
Allow preserving wares left in buildings when dismantling or enhancing #3844
Allow preserving wares left in buildings when dismantling or enhancing #3844
Conversation
Any wares left in the building will, if desired, be dropped out by the builder immediately upon his arrival at the PartiallyFinishedBuilding. Whether this is desired can be set via a checkbox in the confirmation dialogue. This option is checked by default. Ctrl-clicking the dismantle or enhance button will discard any wares left in the building. The AI will always preserve wares when enhancing or dismantling sites.
Seems to work as advertised. Potential issues:
|
Thanks for testing :)
Fixed
Hm… most of the time there isn't a reason to dismantle a warehouse, is there? The only case I can think of is the 2nd frisian scenario where the player has to dismantle the port. But there the objective tells him to first move all wares to a new warehouse. |
…b.com:Noordfrees/widelands into 1431-remove-wares-before-dismantle-or-upgrade
Tried this branch for the first time today, loading an existing savegame. I can't build flags on medium building sites. Small and large sites, as well as the tiny sites (where flags are the only possibility) have the tab for building flags. But not medium sites. |
I cannot confirm this, can you upload a screenshot? |
The changes work fine. (I sometimes get segfaults when dismantling a port but it happens in master too)
It should be fine to truncate the list of displayed wares to an amount that can be shown without problems, and display some sort of indicator that there are more. @spth Are you sure you didn't click a field next to an existing flag? You can't build flags next to each other. |
All right, using a scrollbar layout now when too many wares queues are present. This fixes the vertical oversize. For very large queues, I cut off the waresqueue display at the right edge of the window, which indicates to the user that there are many more items than visible in the queue. |
I'm afraid changing the scrollbar style is out of scope for this branch: I would consider the fact that wares are drawn below the scrollbar desirable because it indicates that there are more wares than fit into the window… |
It's not the best indicator because it depends on the scrollbar position whether it can be seen or not.
It's not very important though, so it can stay like it is too. |
Yes, the |
It happened to me earlier today. I only noticed it after playing for about half an hour, so I don't know if the problem was there from when I first loaded the savegame. I was playing as red empire on the Lesser Ring map. I now tried to reproduce the issue, but failed to do so. When loading savegames saved with the branch or the normal version (all red empire on Lesser Ring), I always see the flag tab there, as it should be, thus I cannot provide a screenshot. But when the problem happened earlier today, the tab was simply missing on all the medium (yellow) sites (just as if there was already a flag next to the site). |
There are some issues that could work differently:
That said, those are really minor tunings IMHO. I tried to play this game but failed to make it do anything wrong. I also browsed through the code and it seemed to make sense. At what level of certainty the reviews should be? "seems to make sense" != "everything already understood and found rock solid" |
Forgot to say the obvious: Great improvement! |
IMHO it would be better to send them away in that case as well. Otherwise this would take control away from the player for rare wares, e.g. when upgrading your metal workshop to an axe factory it would be good if the iron could be sent to another metal workshop in the meantime.
How about dropping the wares out round-robin?
If you think a certain piece of code might work incorrectly in any imaginable corner-case, shout aloud! If the semantics of any code piece aren't obvious, ask! Other than that, if it is working correctly, "makes sense" is good enough. |
Cases like "enemy gains control of upgradesite while unloading in progress" untested (I do not have suitable multiplayer savegame at hand). Have you verified (by reading the code with goggles of that color, for example,) that lost wares are deleted and not anywhere referenced after the event? |
…ove-wares-before-dismantle-or-upgrade
Good point :) I would never have thought of that, and this is exactly the kind of corner-case that causes bugs to be merged. |
Much simpler (=less bugs) and equally effective. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I read this through twice and did not capture anything suspicious.
Thanks for the reviews :) |
Any wares left in the building will, if desired, be dropped out by the builder immediately upon his arrival at the PartiallyFinishedBuilding.
Whether this is desired can be set via a checkbox in the confirmation dialogue. This option is checked by default.
Ctrl-clicking the dismantle or enhance button will discard any wares left in the building.
The AI will always preserve wares when enhancing or dismantling sites.
Fixes #1431