Changeset - r18315:34423392c727
[Not reviewed]
master
0 1 0
yexo - 13 years ago 2011-11-08 17:40:48
yexo@openttd.org
(svn r23161) -Fix (r23154): don't convert pointer to bool but actually check the grf_version variable
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/newgrf_airporttiles.cpp
Show inline comments
 
@@ -174,49 +174,49 @@ static uint32 AirportTileGetVariable(con
 
	assert(st != NULL);
 

	
 
	if (object->scope == VSG_SCOPE_PARENT) {
 
		DEBUG(grf, 1, "Parent scope for airport tiles unavailable");
 
		*available = false;
 
		return UINT_MAX;
 
	}
 

	
 
	extern uint32 GetRelativePosition(TileIndex tile, TileIndex ind_tile);
 

	
 
	switch (variable) {
 
		/* Terrain type */
 
		case 0x41: return GetTerrainType(tile);
 

	
 
		/* Current town zone of the tile in the nearest town */
 
		case 0x42: return GetTownRadiusGroup(ClosestTownFromTile(tile, UINT_MAX), tile);
 

	
 
		/* Position relative to most northern airport tile. */
 
		case 0x43: return GetRelativePosition(tile, st->airport.tile);
 

	
 
		/* Animation frame of tile */
 
		case 0x44: return GetAnimationFrame(tile);
 

	
 
		/* Land info of nearby tiles */
 
		case 0x60: return GetNearbyAirportTileInformation(parameter, tile, st->index, object->grffile);
 
		case 0x60: return GetNearbyAirportTileInformation(parameter, tile, st->index, object->grffile->grf_version >= 8);
 

	
 
		/* Animation stage of nearby tiles */
 
		case 0x61:
 
			tile = GetNearbyTile(parameter, tile);
 
			if (st->TileBelongsToAirport(tile)) {
 
				return GetAnimationFrame(tile);
 
			}
 
			return UINT_MAX;
 

	
 
		/* Get airport tile ID at offset */
 
		case 0x62: return GetAirportTileIDAtOffset(GetNearbyTile(parameter, tile), st, object->grffile->grfid);
 
	}
 

	
 
	DEBUG(grf, 1, "Unhandled airport tile variable 0x%X", variable);
 

	
 
	*available = false;
 
	return UINT_MAX;
 
}
 

	
 
static uint32 AirportTileGetRandomBits(const ResolverObject *object)
 
{
 
	const Station *st = object->u.airport.st;
 
	const TileIndex tile = object->u.airport.tile;
 
	return (st == NULL ? 0 : st->random_bits) | (tile == INVALID_TILE ? 0 : GetStationTileRandomBits(tile) << 16);
0 comments (0 inline, 0 general)