mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-18 01:42:38 +01:00
* Fix #13299: Merge IT_INVALID and INVALID_INDUSTRYTYPE * Codefix: Use NUM_INDUSTRYTILES where it's intended
This commit is contained in:
@@ -214,7 +214,7 @@
|
||||
|
||||
/* static */ IndustryType ScriptIndustry::GetIndustryType(IndustryID industry_id)
|
||||
{
|
||||
if (!IsValidIndustry(industry_id)) return INVALID_INDUSTRYTYPE;
|
||||
if (!IsValidIndustry(industry_id)) return IT_INVALID;
|
||||
|
||||
return ::Industry::Get(industry_id)->type;
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@
|
||||
|
||||
/* static */ IndustryType ScriptIndustryType::ResolveNewGRFID(SQInteger grfid, SQInteger grf_local_id)
|
||||
{
|
||||
EnforcePrecondition(INVALID_INDUSTRYTYPE, IsInsideBS(grf_local_id, 0x00, NUM_INDUSTRYTYPES_PER_GRF));
|
||||
EnforcePrecondition(IT_INVALID, IsInsideBS(grf_local_id, 0x00, NUM_INDUSTRYTYPES_PER_GRF));
|
||||
|
||||
grfid = BSWAP32(GB(grfid, 0, 32)); // Match people's expectations.
|
||||
return _industry_mngr.GetID(grf_local_id, grfid);
|
||||
|
||||
Reference in New Issue
Block a user