(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

@@ -266,11 +266,6 @@ void SetIndustryDailyChanges();
extern uint16 _industry_counts[NUM_INDUSTRYTYPES]; // Number of industries per type ingame
static inline uint GetNumIndustries()
{
return (uint)Industry::GetNumItems();
}
/** Increment the count of industries for this type
* @param type IndustryType to increment
* @pre type < INVALID_INDUSTRYTYPE */
@@ -310,10 +305,10 @@ static inline void ResetIndustryCounts()
*/
static inline Industry *GetRandomIndustry()
{
int num = RandomRange(GetNumIndustries());
IndustryID index = INVALID_INDUSTRY;
if (Industry::GetNumItems() == 0) return NULL;
if (GetNumIndustries() == 0) return NULL;
int num = RandomRange((uint16)Industry::GetNumItems());
IndustryID index = INVALID_INDUSTRY;
while (num >= 0) {
num--;