From 5eaf9d39bf57ab3983a4f9227f31c5806636de3d Mon Sep 17 00:00:00 2001 From: glx22 Date: Sat, 4 Mar 2023 15:50:28 +0100 Subject: [PATCH] Codechange: Use SQInteger for generic numbers in script_industrytype --- src/script/api/script_industrytype.cpp | 4 ++-- src/script/api/script_industrytype.hpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/script/api/script_industrytype.cpp b/src/script/api/script_industrytype.cpp index 3101ac7fdc..f439b477f8 100644 --- a/src/script/api/script_industrytype.cpp +++ b/src/script/api/script_industrytype.cpp @@ -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); } diff --git a/src/script/api/script_industrytype.hpp b/src/script/api/script_industrytype.hpp index ff32a63c2e..3b4ec52c62 100644 --- a/src/script/api/script_industrytype.hpp +++ b/src/script/api/script_industrytype.hpp @@ -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 */