Changeset - r16331:77622ea88835
[Not reviewed]
master
0 6 0
yexo - 14 years ago 2010-10-28 11:10:12
yexo@openttd.org
(svn r21052) -Fix (r20435): house/airporttile/industrytile newgrfs that defined tiles that relied on the substitute being drawn were broken
6 files changed with 8 insertions and 8 deletions:
0 comments (0 inline, 0 general)
src/industry_cmd.cpp
Show inline comments
 
@@ -306,7 +306,7 @@ static void DrawTile_Industry(TileInfo *
 
		 * DrawNewIndustry will return false if ever the resolver could not
 
		 * find any sprite to display.  So in this case, we will jump on the
 
		 * substitute gfx instead. */
 
		if (indts->grf_prop.spritegroup != NULL && DrawNewIndustryTile(ti, ind, gfx, indts)) {
 
		if (indts->grf_prop.spritegroup[0] != NULL && DrawNewIndustryTile(ti, ind, gfx, indts)) {
 
			return;
 
		} else {
 
			/* No sprite group (or no valid one) found, meaning no graphics associated.
 
@@ -375,7 +375,7 @@ static Foundation GetFoundation_Industry
 
	 */
 
	if (gfx >= NEW_INDUSTRYTILEOFFSET) {
 
		const IndustryTileSpec *indts = GetIndustryTileSpec(gfx);
 
		if (indts->grf_prop.spritegroup != NULL && HasBit(indts->callback_mask, CBM_INDT_DRAW_FOUNDATIONS)) {
 
		if (indts->grf_prop.spritegroup[0] != NULL && HasBit(indts->callback_mask, CBM_INDT_DRAW_FOUNDATIONS)) {
 
			uint32 callback_res = GetIndustryTileCallback(CBID_INDTILE_DRAW_FOUNDATIONS, 0, 0, gfx, Industry::GetByTile(tile), tile);
 
			if (callback_res == 0) return FOUNDATION_NONE;
 
		}
src/newgrf_airporttiles.cpp
Show inline comments
 
@@ -155,7 +155,7 @@ static uint32 GetAirportTileIDAtOffset(T
 
		}
 
	}
 
	/* Not an 'old type' tile */
 
	if (ats->grf_prop.spritegroup != NULL) { // tile has a spritegroup ?
 
	if (ats->grf_prop.spritegroup[0] != NULL) { // tile has a spritegroup ?
 
		if (ats->grf_prop.grffile->grfid == cur_grfid) { // same airport, same grf ?
 
			return ats->grf_prop.local_id;
 
		} else {
src/newgrf_industries.cpp
Show inline comments
 
@@ -76,7 +76,7 @@ uint32 GetIndustryIDAtOffset(TileIndex t
 
		}
 
	}
 
	/* Not an 'old type' tile */
 
	if (indtsp->grf_prop.spritegroup != NULL) { // tile has a spritegroup ?
 
	if (indtsp->grf_prop.spritegroup[0] != NULL) { // tile has a spritegroup ?
 
		if (indtsp->grf_prop.grffile->grfid == cur_grfid) { // same industry, same grf ?
 
			return indtsp->grf_prop.local_id;
 
		} else {
src/newgrf_industrytiles.cpp
Show inline comments
 
@@ -355,7 +355,7 @@ static void DoTriggerIndustryTile(TileIn
 
	IndustryGfx gfx = GetIndustryGfx(tile);
 
	const IndustryTileSpec *itspec = GetIndustryTileSpec(gfx);
 

	
 
	if (itspec->grf_prop.spritegroup == NULL) return;
 
	if (itspec->grf_prop.spritegroup[0] == NULL) return;
 

	
 
	NewIndustryTileResolver(&object, gfx, tile, ind);
 

	
src/station_cmd.cpp
Show inline comments
 
@@ -2568,7 +2568,7 @@ static void DrawTile_Station(TileInfo *t
 
		StationGfx gfx = GetAirportGfx(ti->tile);
 
		if (gfx >= NEW_AIRPORTTILE_OFFSET) {
 
			const AirportTileSpec *ats = AirportTileSpec::Get(gfx);
 
			if (ats->grf_prop.spritegroup != NULL && DrawNewAirportTile(ti, Station::GetByTile(ti->tile), gfx, ats)) {
 
			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.
src/town_cmd.cpp
Show inline comments
 
@@ -207,7 +207,7 @@ static void DrawTile_Town(TileInfo *ti)
 
		/* Houses don't necessarily need new graphics. If they don't have a
 
		 * spritegroup associated with them, then the sprite for the substitute
 
		 * house id is drawn instead. */
 
		if (HouseSpec::Get(house_id)->grf_prop.spritegroup != NULL) {
 
		if (HouseSpec::Get(house_id)->grf_prop.spritegroup[0] != NULL) {
 
			DrawNewHouseTile(ti, house_id);
 
			return;
 
		} else {
 
@@ -264,7 +264,7 @@ static Foundation GetFoundation_Town(Til
 
	 */
 
	if (hid >= NEW_HOUSE_OFFSET) {
 
		const HouseSpec *hs = HouseSpec::Get(hid);
 
		if (hs->grf_prop.spritegroup != NULL && HasBit(hs->callback_mask, CBM_HOUSE_DRAW_FOUNDATIONS)) {
 
		if (hs->grf_prop.spritegroup[0] != NULL && HasBit(hs->callback_mask, CBM_HOUSE_DRAW_FOUNDATIONS)) {
 
			uint32 callback_res = GetHouseCallback(CBID_HOUSE_DRAW_FOUNDATIONS, 0, 0, hid, Town::GetByTile(tile), tile);
 
			if (callback_res == 0) return FOUNDATION_NONE;
 
		}
0 comments (0 inline, 0 general)