(svn r1771) -Add: Industries are now dynamic (up to 64k industries). Generating

1kx1k maps should now be much faster, and give more than just oil-stuff ;)
This commit is contained in:
truelight
2005-02-02 17:30:29 +00:00
parent ab3ed5c431
commit 83a889d678
5 changed files with 82 additions and 43 deletions

View File

@@ -493,7 +493,7 @@ static byte _industry_sort_order;
static int CDECL GeneralIndustrySorter(const void *a, const void *b)
{
char buf1[96];
byte val;
uint16 val;
Industry *i = GetIndustry(*(const uint16*)a);
Industry *j = GetIndustry(*(const uint16*)b);
int r = 0;
@@ -557,7 +557,7 @@ static void MakeSortedIndustryList(void)
int n = 0;
/* Create array for sorting */
_industry_sort = realloc(_industry_sort, _industries_size * sizeof(_industry_sort[0]));
_industry_sort = realloc(_industry_sort, GetIndustryPoolSize() * sizeof(_industry_sort[0]));
if (_industry_sort == NULL)
error("Could not allocate memory for the industry-sorting-list");