widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #00159
[Merge] lp:~nomeata/widelands/bugfix669138 into lp:widelands
Joachim Breitner has proposed merging lp:~nomeata/widelands/bugfix669138 into lp:widelands.
Requested reviews:
Widelands Developers (widelands-dev)
Related bugs:
#669138 Target quantity window for workers is broken
https://bugs.launchpad.net/bugs/669138
Just some refactoring-fallout...
--
https://code.launchpad.net/~nomeata/widelands/bugfix669138/+merge/39712
Your team Widelands Developers is requested to review the proposed merge of lp:~nomeata/widelands/bugfix669138 into lp:widelands.
=== modified file 'src/wui/transport_ui.cc'
--- src/wui/transport_ui.cc 2010-10-30 14:58:13 +0000
+++ src/wui/transport_ui.cc 2010-10-31 16:40:00 +0000
@@ -79,10 +79,19 @@
AbstractWaresDisplay(parent, x, y, tribe, type, selectable) ,
m_economy(economy)
{
- Ware_Index nr_wares = m_economy.owner().tribe().get_nrwares();
- for (Ware_Index i = Ware_Index::First(); i < nr_wares; ++i) {
- if (not m_economy.owner().tribe().get_ware_descr(i)->has_demand_check()) {
- hide_ware(i);
+ if (type == WaresDisplay::WORKER) {
+ Ware_Index nr_wares = m_economy.owner().tribe().get_nrworkers();
+ for (Ware_Index i = Ware_Index::First(); i < nr_wares; ++i) {
+ if (not m_economy.owner().tribe().get_worker_descr(i)->has_demand_check()) {
+ hide_ware(i);
+ }
+ }
+ } else {
+ Ware_Index nr_wares = m_economy.owner().tribe().get_nrwares();
+ for (Ware_Index i = Ware_Index::First(); i < nr_wares; ++i) {
+ if (not m_economy.owner().tribe().get_ware_descr(i)->has_demand_check()) {
+ hide_ware(i);
+ }
}
}
}
Follow ups