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
pull/584/head
Jonathan G Rennison 11 months ago
parent 752b0bce47
commit 5bcc71f2c2

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

Loading…
Cancel
Save