1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-20 02:42:42 +01:00

Fix #13299: Merge IT_INVALID and INVALID_INDUSTRYTYPE (#13300)

* Fix #13299: Merge IT_INVALID and INVALID_INDUSTRYTYPE

* Codefix: Use NUM_INDUSTRYTILES where it's intended
This commit is contained in:
Loïc Guilloux
2025-01-10 01:17:11 +01:00
committed by GitHub
parent c0edbe0d37
commit 46f181c8a6
10 changed files with 32 additions and 34 deletions

View File

@@ -210,13 +210,13 @@ uint16_t GetAiPurchaseCallbackResult(uint8_t feature, CargoID cargo_type, uint8_
if (src_industry != IT_AI_UNKNOWN && src_industry != IT_AI_TOWN) {
const IndustrySpec *is = GetIndustrySpec(src_industry);
/* If this is no original industry, use the substitute type */
if (is->grf_prop.subst_id != INVALID_INDUSTRYTYPE) src_industry = is->grf_prop.subst_id;
if (is->grf_prop.subst_id != IT_INVALID) src_industry = is->grf_prop.subst_id;
}
if (dst_industry != IT_AI_UNKNOWN && dst_industry != IT_AI_TOWN) {
const IndustrySpec *is = GetIndustrySpec(dst_industry);
/* If this is no original industry, use the substitute type */
if (is->grf_prop.subst_id != INVALID_INDUSTRYTYPE) dst_industry = is->grf_prop.subst_id;
if (is->grf_prop.subst_id != IT_INVALID) dst_industry = is->grf_prop.subst_id;
}
object.generic_scope.cargo_type = cargo_type;