(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

@@ -334,7 +334,7 @@ public:
if (this->selected_type == INVALID_INDUSTRYTYPE) {
this->HandleButtonClick(DPIW_FUND_WIDGET);
if (GetNumTowns() == 0) {
if (Town::GetNumItems() == 0) {
ShowErrorMessage(STR_ERROR_MUST_BUILD_TOWN_FIRST, STR_CAN_T_GENERATE_INDUSTRIES, 0, 0);
} else {
extern void GenerateIndustries();
@@ -368,7 +368,7 @@ public:
if (_game_mode == GM_EDITOR) {
/* Show error if no town exists at all */
if (GetNumTowns() == 0) {
if (Town::GetNumItems() == 0) {
SetDParam(0, indsp->name);
ShowErrorMessage(STR_ERROR_MUST_BUILD_TOWN_FIRST, STR_ERROR_CAN_T_BUILD_HERE, pt.x, pt.y);
return;