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:
@@ -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)) {
|
||||||
|
Reference in New Issue
Block a user