|
|
@ -1916,7 +1916,7 @@ static void DoCreateNewIndustry(Industry *i, TileIndex tile, IndustryType type,
|
|
|
|
/* Clear all input cargo types */
|
|
|
|
/* Clear all input cargo types */
|
|
|
|
for (size_t j = 0; j < i->accepts_cargo.size(); j++) i->accepts_cargo[j] = INVALID_CARGO;
|
|
|
|
for (size_t j = 0; j < i->accepts_cargo.size(); j++) i->accepts_cargo[j] = INVALID_CARGO;
|
|
|
|
/* Query actual types */
|
|
|
|
/* Query actual types */
|
|
|
|
uint maxcargoes = (indspec->behaviour & INDUSTRYBEH_CARGOTYPES_UNLIMITED) ? std::size(i->accepts_cargo) : 3;
|
|
|
|
uint maxcargoes = (indspec->behaviour & INDUSTRYBEH_CARGOTYPES_UNLIMITED) ? (uint)std::size(i->accepts_cargo) : 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;
|
|
|
@ -1948,7 +1948,7 @@ static void DoCreateNewIndustry(Industry *i, TileIndex tile, IndustryType type,
|
|
|
|
/* Clear all output cargo types */
|
|
|
|
/* Clear all output cargo types */
|
|
|
|
for (size_t j = 0; j < i->produced_cargo.size(); j++) i->produced_cargo[j] = INVALID_CARGO;
|
|
|
|
for (size_t j = 0; j < i->produced_cargo.size(); j++) i->produced_cargo[j] = INVALID_CARGO;
|
|
|
|
/* Query actual types */
|
|
|
|
/* Query actual types */
|
|
|
|
uint maxcargoes = (indspec->behaviour & INDUSTRYBEH_CARGOTYPES_UNLIMITED) ? std::size(i->produced_cargo) : 2;
|
|
|
|
uint maxcargoes = (indspec->behaviour & INDUSTRYBEH_CARGOTYPES_UNLIMITED) ? (uint)std::size(i->produced_cargo) : 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;
|
|
|
|