(svn r26308) -Fix-ish: do not try to build more towns/industries than the pool can hold (MJP)

This commit is contained in:
rubidium
2014-02-06 20:42:09 +00:00
parent 3d2a8bb1e9
commit 732ae5b600
2 changed files with 2 additions and 1 deletions

View File

@@ -1995,7 +1995,7 @@ static uint GetNumberOfIndustries()
assert(lengthof(numof_industry_table) == ID_END);
uint difficulty = (_game_mode != GM_EDITOR) ? _settings_game.difficulty.industry_density : (uint)ID_VERY_LOW;
return ScaleByMapSize(numof_industry_table[difficulty]);
return min(IndustryPool::MAX_SIZE, ScaleByMapSize(numof_industry_table[difficulty]));
}
/**