(svn r16379) -Codechange: remove GetNumTowns(), GetNumIndustries() and GetActiveCompanyCount(), use PoolItem::GetNumItems() instead

This commit is contained in:
smatz
2009-05-22 15:23:47 +00:00
parent 62a7948af0
commit 10d1ef5447
15 changed files with 22 additions and 37 deletions

View File

@@ -142,7 +142,7 @@ static void ShowTownnameDropdown(Window *w, int sel)
DropDownList *list = new DropDownList();
for (TownList::iterator it = townnames.begin(); it != townnames.end(); it++) {
list->push_back(new DropDownListStringItem((*it).first, (*it).second, !(_game_mode == GM_MENU || GetNumTowns() == 0 || (*it).second == sel)));
list->push_back(new DropDownListStringItem((*it).first, (*it).second, !(_game_mode == GM_MENU || Town::GetNumItems() == 0 || (*it).second == sel)));
}
ShowDropDownList(w, list, sel, GOW_TOWNNAME_DROPDOWN);
@@ -305,7 +305,7 @@ struct GameOptionsWindow : Window {
break;
case GOW_TOWNNAME_DROPDOWN: // Town names
if (_game_mode == GM_MENU || GetNumTowns() == 0) {
if (_game_mode == GM_MENU || Town::GetNumItems() == 0) {
this->opt->game_creation.town_name = index;
InvalidateWindow(WC_GAME_OPTIONS, 0);
}