Fix incorrect industry NewGRF text ID mapping

In the case where the lower 16 bits of the internal string ID
was also a valid NewGRF string ID
This commit is contained in:
Jonathan G Rennison
2023-08-06 01:21:19 +01:00
parent 752b0bce47
commit 5bcc71f2c2

View File

@@ -615,6 +615,8 @@ StringID AddGRFString(uint32 grfid, uint16 stringid, byte langid_to_add, bool ne
*/
StringID GetGRFStringID(uint32 grfid, StringID stringid)
{
if (stringid > UINT16_MAX) return STR_UNDEFINED;
extern GRFFile *GetFileByGRFIDExpectCurrent(uint32 grfid);
GRFFile *grf = GetFileByGRFIDExpectCurrent(grfid);
if (unlikely(grf == nullptr)) {