Merge branch 'master' into jgrpp

# Conflicts:
#	src/fileio.cpp
#	src/fileio_func.h
#	src/industry_cmd.cpp
#	src/ini.cpp
#	src/openttd.cpp
#	src/os/windows/win32_main.cpp
#	src/settingsgen/settingsgen.cpp
#	src/strgen/strgen.cpp
#	src/strings.cpp
This commit is contained in:
Jonathan G Rennison
2024-06-10 22:38:15 +01:00
26 changed files with 175 additions and 138 deletions

View File

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