Merge lp:~widelands-dev/widelands/constructionsite_options into lp:widelands

Proposed by Benedikt Straub
Status: Merged
Merged at revision: 9177
Proposed branch: lp:~widelands-dev/widelands/constructionsite_options
Merge into: lp:widelands
Diff against target: 25 lines (+8/-0)
1 file modified
src/logic/map_objects/tribes/productionsite.cc (+8/-0)
To merge this branch: bzr merge lp:~widelands-dev/widelands/constructionsite_options
Reviewer Review Type Date Requested Status
Widelands Developers Pending
Review via email: mp+371170@code.launchpad.net

Commit message

Set emptied input queues to max fill when enhancing a building

To post a comment you must log in.
Revision history for this message
Klaus Halfmann (klaus-halfmann) wrote :

+1 one for this. While playtesting on trunk I always was hit by this.

Code looks straigforward, no time for a complete review by now.

Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 5313. State: passed. Details: https://travis-ci.org/widelands/widelands/builds/570516864.
Appveyor build 5086. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_constructionsite_options-5086.

Revision history for this message
GunChleoc (gunchleoc) wrote :

Code LGTM :)

@bunnybot merge

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/logic/map_objects/tribes/productionsite.cc'
--- src/logic/map_objects/tribes/productionsite.cc 2019-06-23 12:45:29 +0000
+++ src/logic/map_objects/tribes/productionsite.cc 2019-08-11 16:00:35 +0000
@@ -1049,6 +1049,11 @@
1049 for (const auto& queue : input_queues_) {1049 for (const auto& queue : input_queues_) {
1050 if (queue->get_type() == wwWARE && queue->get_index() == pair.first) {1050 if (queue->get_type() == wwWARE && queue->get_index() == pair.first) {
1051 pair.second.desired_fill = std::min(pair.second.max_fill, queue->get_max_fill());1051 pair.second.desired_fill = std::min(pair.second.max_fill, queue->get_max_fill());
1052 if (pair.second.desired_fill == 0) {
1053 // Players may set slots to 0 before enhancing a building to retrieve precious wares –
1054 // we assume they want the slot to be fully filled in the upgraded building
1055 pair.second.desired_fill = pair.second.max_fill;
1056 }
1052 break;1057 break;
1053 }1058 }
1054 }1059 }
@@ -1058,6 +1063,9 @@
1058 for (const auto& queue : input_queues_) {1063 for (const auto& queue : input_queues_) {
1059 if (queue->get_type() == wwWORKER && queue->get_index() == pair.first) {1064 if (queue->get_type() == wwWORKER && queue->get_index() == pair.first) {
1060 pair.second.desired_fill = std::min(pair.second.max_fill, queue->get_max_fill());1065 pair.second.desired_fill = std::min(pair.second.max_fill, queue->get_max_fill());
1066 if (pair.second.desired_fill == 0) {
1067 pair.second.desired_fill = pair.second.max_fill;
1068 }
1061 break;1069 break;
1062 }1070 }
1063 }1071 }

Subscribers

People subscribed via source and target branches

to status/vote changes: