Codechange: Use SQInteger for generic numbers in script_industrytype

This commit is contained in:
glx22 2023-03-04 15:50:28 +01:00 committed by Loïc Guilloux
parent 6671994655
commit 5eaf9d39bf
2 changed files with 3 additions and 3 deletions

View File

@ -156,10 +156,10 @@
return (::GetIndustrySpec(industry_type)->behaviour & INDUSTRYBEH_AI_AIRSHIP_ROUTES) != 0;
}
/* static */ IndustryType ScriptIndustryType::ResolveNewGRFID(uint32 grfid, uint16 grf_local_id)
/* static */ IndustryType ScriptIndustryType::ResolveNewGRFID(SQInteger grfid, SQInteger grf_local_id)
{
EnforcePrecondition(INVALID_INDUSTRYTYPE, IsInsideBS(grf_local_id, 0x00, NUM_INDUSTRYTYPES_PER_GRF));
grfid = BSWAP32(grfid); // Match people's expectations.
grfid = BSWAP32(GB(grfid, 0, 32)); // Match people's expectations.
return _industry_mngr.GetID(grf_local_id, grfid);
}

View File

@ -189,7 +189,7 @@ public:
* @pre 0x00 <= grf_local_id < NUM_INDUSTRYTYPES_PER_GRF.
* @return the industry-type ID, local to the current game (this diverges from the grf_local_id).
*/
static IndustryType ResolveNewGRFID(uint32 grfid, uint16 grf_local_id);
static IndustryType ResolveNewGRFID(SQInteger grfid, SQInteger grf_local_id);
};
#endif /* SCRIPT_INDUSTRYTYPE_HPP */