mirror of https://github.com/OpenTTD/OpenTTD
(svn r22757) -Fix [FS#4730]: [NewGRF] Invalid memory access when querying the grfID of the default objects
parent
2dd798149b
commit
86234253a5
|
@ -140,6 +140,11 @@ static uint32 GetObjectIDAtOffset(TileIndex tile, uint32 cur_grfid)
|
||||||
|
|
||||||
const ObjectSpec *spec = ObjectSpec::GetByTile(tile);
|
const ObjectSpec *spec = ObjectSpec::GetByTile(tile);
|
||||||
|
|
||||||
|
/* Default objects have no associated NewGRF file */
|
||||||
|
if (spec->grf_prop.grffile == NULL) {
|
||||||
|
return 0xFFFE; // Defined in another grf file
|
||||||
|
}
|
||||||
|
|
||||||
if (spec->grf_prop.grffile->grfid == cur_grfid) { // same object, same grf ?
|
if (spec->grf_prop.grffile->grfid == cur_grfid) { // same object, same grf ?
|
||||||
return spec->grf_prop.local_id;
|
return spec->grf_prop.local_id;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue