Changeset - r18602:fcc1fa832dbe
[Not reviewed]
master
0 1 0
yexo - 13 years ago 2011-12-09 17:14:03
yexo@openttd.org
(svn r23459) -Fix: don't crash trying to draw airport tiles when the airport grf is missing
1 file changed with 3 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/station_cmd.cpp
Show inline comments
 
@@ -2610,14 +2610,15 @@ static void DrawTile_Station(TileInfo *t
 
		}
 
	} else {
 
		roadtypes = IsRoadStop(ti->tile) ? GetRoadTypes(ti->tile) : ROADTYPES_NONE;
 
		total_offset = 0;
 
	}
 

	
 
	StationGfx gfx = GetStationGfx(ti->tile);
 
	if (IsAirport(ti->tile)) {
 
		StationGfx gfx = GetAirportGfx(ti->tile);
 
		gfx = GetAirportGfx(ti->tile);
 
		if (gfx >= NEW_AIRPORTTILE_OFFSET) {
 
			const AirportTileSpec *ats = AirportTileSpec::Get(gfx);
 
			if (ats->grf_prop.spritegroup[0] != NULL && DrawNewAirportTile(ti, Station::GetByTile(ti->tile), gfx, ats)) {
 
				return;
 
			}
 
			/* No sprite group (or no valid one) found, meaning no graphics associated.
 
@@ -2651,13 +2652,13 @@ static void DrawTile_Station(TileInfo *t
 
		palette = COMPANY_SPRITE_COLOUR(owner);
 
	} else {
 
		/* Some stations are not owner by a company, namely oil rigs */
 
		palette = PALETTE_TO_GREY;
 
	}
 

	
 
	if (layout == NULL && (t == NULL || t->seq == NULL)) t = GetStationTileLayout(GetStationType(ti->tile), GetStationGfx(ti->tile));
 
	if (layout == NULL && (t == NULL || t->seq == NULL)) t = GetStationTileLayout(GetStationType(ti->tile), gfx);
 

	
 
	/* don't show foundation for docks */
 
	if (ti->tileh != SLOPE_FLAT && !IsDock(ti->tile)) {
 
		if (statspec != NULL && HasBit(statspec->flags, SSF_CUSTOM_FOUNDATIONS)) {
 
			/* Station has custom foundations.
 
			 * Check whether the foundation continues beyond the tile's upper sides. */
0 comments (0 inline, 0 general)