src/industry_gui.cpp
changeset 5609 dc6a58930ba4
parent 5601 d58f82901b2f
child 5893 7e431a4abebb
equal deleted inserted replaced
5608:0b0aff054402 5609:dc6a58930ba4
   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;