src/industry_gui.cpp
changeset 5860 7fdc9b423ba1
parent 5852 cb3f71b16e1a
child 6144 5a0ffbf27ced
equal deleted inserted replaced
5859:158718283d16 5860:7fdc9b423ba1
   558 
   558 
   559 	/* Don't attempt a sort if there are no industries */
   559 	/* Don't attempt a sort if there are no industries */
   560 	if (GetNumIndustries() == 0) return;
   560 	if (GetNumIndustries() == 0) return;
   561 
   561 
   562 	/* Create array for sorting */
   562 	/* Create array for sorting */
   563 	ReallocT(&_industry_sort, GetMaxIndustryIndex() + 1);
   563 	_industry_sort = ReallocT(_industry_sort, GetMaxIndustryIndex() + 1);
   564 	if (_industry_sort == NULL) error("Could not allocate memory for the industry-sorting-list");
   564 	if (_industry_sort == NULL) error("Could not allocate memory for the industry-sorting-list");
   565 
   565 
   566 	FOR_ALL_INDUSTRIES(i) _industry_sort[n++] = i;
   566 	FOR_ALL_INDUSTRIES(i) _industry_sort[n++] = i;
   567 
   567 
   568 	_num_industry_sort = n;
   568 	_num_industry_sort = n;