Changeset - r17938:d5dd4c8acedd
[Not reviewed]
master
0 1 0
planetmaker - 13 years ago 2011-08-18 14:08:51
planetmaker@openttd.org
(svn r22757) -Fix [FS#4730]: [NewGRF] Invalid memory access when querying the grfID of the default objects
1 file changed with 5 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/newgrf_object.cpp
Show inline comments
 
@@ -140,6 +140,11 @@ static uint32 GetObjectIDAtOffset(TileIn
 

	
 
	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 ?
 
		return spec->grf_prop.local_id;
 
	}
0 comments (0 inline, 0 general)