changeset 16341:d177aab74b30 draft

(svn r21052) -Fix (r20435): house/airporttile/industrytile newgrfs that defined tiles that relied on the substitute being drawn were broken
author yexo <yexo@openttd.org>
date Thu, 28 Oct 2010 11:10:12 +0000
parents 0e01a13b1530
children cb5090611ea0
files src/industry_cmd.cpp src/newgrf_airporttiles.cpp src/newgrf_industries.cpp src/newgrf_industrytiles.cpp src/station_cmd.cpp src/town_cmd.cpp
diffstat 6 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -306,7 +306,7 @@
 		 * 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 @@
 	 */
 	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;
 		}
--- a/src/newgrf_airporttiles.cpp
+++ b/src/newgrf_airporttiles.cpp
@@ -155,7 +155,7 @@
 		}
 	}
 	/* 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 {
--- a/src/newgrf_industries.cpp
+++ b/src/newgrf_industries.cpp
@@ -76,7 +76,7 @@
 		}
 	}
 	/* 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 {
--- a/src/newgrf_industrytiles.cpp
+++ b/src/newgrf_industrytiles.cpp
@@ -355,7 +355,7 @@
 	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);
 
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -2568,7 +2568,7 @@
 		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.
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -207,7 +207,7 @@
 		/* 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 @@
 	 */
 	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;
 		}