|
|
@ -1876,7 +1876,7 @@ static void DoCreateNewIndustry(Industry *i, TileIndex tile, IndustryType type,
|
|
|
|
/* Clear all input cargo types */
|
|
|
|
/* Clear all input cargo types */
|
|
|
|
i->accepted.clear();
|
|
|
|
i->accepted.clear();
|
|
|
|
/* Query actual types */
|
|
|
|
/* Query actual types */
|
|
|
|
uint maxcargoes = (indspec->behaviour & INDUSTRYBEH_CARGOTYPES_UNLIMITED) ? static_cast<uint>(i->accepted.size()) : 3;
|
|
|
|
uint maxcargoes = (indspec->behaviour & INDUSTRYBEH_CARGOTYPES_UNLIMITED) ? INDUSTRY_NUM_INPUTS : 3;
|
|
|
|
for (uint j = 0; j < maxcargoes; j++) {
|
|
|
|
for (uint j = 0; j < maxcargoes; j++) {
|
|
|
|
uint16_t res = GetIndustryCallback(CBID_INDUSTRY_INPUT_CARGO_TYPES, j, 0, i, type, INVALID_TILE);
|
|
|
|
uint16_t res = GetIndustryCallback(CBID_INDUSTRY_INPUT_CARGO_TYPES, j, 0, i, type, INVALID_TILE);
|
|
|
|
if (res == CALLBACK_FAILED || GB(res, 0, 8) == UINT8_MAX) break;
|
|
|
|
if (res == CALLBACK_FAILED || GB(res, 0, 8) == UINT8_MAX) break;
|
|
|
@ -1914,7 +1914,7 @@ static void DoCreateNewIndustry(Industry *i, TileIndex tile, IndustryType type,
|
|
|
|
/* Clear all output cargo types */
|
|
|
|
/* Clear all output cargo types */
|
|
|
|
i->produced.clear();
|
|
|
|
i->produced.clear();
|
|
|
|
/* Query actual types */
|
|
|
|
/* Query actual types */
|
|
|
|
uint maxcargoes = (indspec->behaviour & INDUSTRYBEH_CARGOTYPES_UNLIMITED) ? static_cast<uint>(i->produced.size()) : 2;
|
|
|
|
uint maxcargoes = (indspec->behaviour & INDUSTRYBEH_CARGOTYPES_UNLIMITED) ? INDUSTRY_NUM_OUTPUTS : 2;
|
|
|
|
for (uint j = 0; j < maxcargoes; j++) {
|
|
|
|
for (uint j = 0; j < maxcargoes; j++) {
|
|
|
|
uint16_t res = GetIndustryCallback(CBID_INDUSTRY_OUTPUT_CARGO_TYPES, j, 0, i, type, INVALID_TILE);
|
|
|
|
uint16_t res = GetIndustryCallback(CBID_INDUSTRY_OUTPUT_CARGO_TYPES, j, 0, i, type, INVALID_TILE);
|
|
|
|
if (res == CALLBACK_FAILED || GB(res, 0, 8) == UINT8_MAX) break;
|
|
|
|
if (res == CALLBACK_FAILED || GB(res, 0, 8) == UINT8_MAX) break;
|
|
|
|