(svn r4027) Remove another call to FindLandscapeHeightByTile()
This commit is contained in:
		@@ -1283,8 +1283,6 @@ static const byte _industry_map5_bits[] = {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
static bool CheckIfIndustryTilesAreFree(TileIndex tile, const IndustryTileTable* it, int type, const Town* t)
 | 
					static bool CheckIfIndustryTilesAreFree(TileIndex tile, const IndustryTileTable* it, int type, const Town* t)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	TileInfo ti;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	_error_message = STR_0239_SITE_UNSUITABLE;
 | 
						_error_message = STR_0239_SITE_UNSUITABLE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	do {
 | 
						do {
 | 
				
			||||||
@@ -1295,27 +1293,31 @@ static bool CheckIfIndustryTilesAreFree(TileIndex tile, const IndustryTileTable*
 | 
				
			|||||||
			return false;
 | 
								return false;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		FindLandscapeHeightByTile(&ti, cur_tile);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		if (it->map5 == 0xFF) {
 | 
							if (it->map5 == 0xFF) {
 | 
				
			||||||
			if (ti.type != MP_WATER || ti.tileh != 0) return false;
 | 
								if (!IsTileType(cur_tile, MP_WATER) ||
 | 
				
			||||||
 | 
										GetTileSlope(cur_tile, NULL) != 0) {
 | 
				
			||||||
 | 
									return false;
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			if (!EnsureNoVehicle(cur_tile)) return false;
 | 
								if (!EnsureNoVehicle(cur_tile)) return false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			if (type == IT_OIL_RIG)  {
 | 
								if (type == IT_OIL_RIG)  {
 | 
				
			||||||
				if (ti.type != MP_WATER || ti.map5 != 0) return false;
 | 
									if (!IsTileType(cur_tile, MP_WATER) || _m[cur_tile].m5 != 0) return false;
 | 
				
			||||||
			} else {
 | 
								} else {
 | 
				
			||||||
				if (ti.type == MP_WATER && ti.map5 == 0) return false;
 | 
									uint tileh;
 | 
				
			||||||
				if (IsSteepTileh(ti.tileh))
 | 
					 | 
				
			||||||
					return false;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
				if (ti.tileh != 0) {
 | 
									if (IsTileType(cur_tile, MP_WATER) && _m[cur_tile].m5 == 0) return false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
									tileh = GetTileSlope(cur_tile, NULL);
 | 
				
			||||||
 | 
									if (IsSteepTileh(tileh)) return false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
									if (tileh != 0) {
 | 
				
			||||||
					int t;
 | 
										int t;
 | 
				
			||||||
					byte bits = _industry_map5_bits[it->map5];
 | 
										byte bits = _industry_map5_bits[it->map5];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
					if (bits & 0x10) return false;
 | 
										if (bits & 0x10) return false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
					t = ~ti.tileh;
 | 
										t = ~tileh;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
					if (bits & 1 && (t & (1 + 8))) return false;
 | 
										if (bits & 1 && (t & (1 + 8))) return false;
 | 
				
			||||||
					if (bits & 2 && (t & (4 + 8))) return false;
 | 
										if (bits & 2 && (t & (4 + 8))) return false;
 | 
				
			||||||
@@ -1324,20 +1326,20 @@ static bool CheckIfIndustryTilesAreFree(TileIndex tile, const IndustryTileTable*
 | 
				
			|||||||
				}
 | 
									}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				if (type == IT_BANK) {
 | 
									if (type == IT_BANK) {
 | 
				
			||||||
					if (ti.type != MP_HOUSE || t->population < 1200) {
 | 
										if (!IsTileType(cur_tile, MP_HOUSE) || t->population < 1200) {
 | 
				
			||||||
						_error_message = STR_029D_CAN_ONLY_BE_BUILT_IN_TOWNS;
 | 
											_error_message = STR_029D_CAN_ONLY_BE_BUILT_IN_TOWNS;
 | 
				
			||||||
						return false;
 | 
											return false;
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
				} else if (type == IT_BANK_2) {
 | 
									} else if (type == IT_BANK_2) {
 | 
				
			||||||
					if (ti.type != MP_HOUSE) {
 | 
										if (!IsTileType(cur_tile, MP_HOUSE)) {
 | 
				
			||||||
						_error_message = STR_030D_CAN_ONLY_BE_BUILT_IN_TOWNS;
 | 
											_error_message = STR_030D_CAN_ONLY_BE_BUILT_IN_TOWNS;
 | 
				
			||||||
						return false;
 | 
											return false;
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
				} else if (type == IT_TOY_SHOP) {
 | 
									} else if (type == IT_TOY_SHOP) {
 | 
				
			||||||
					if (DistanceMax(t->xy, cur_tile) > 9) return false;
 | 
										if (DistanceMax(t->xy, cur_tile) > 9) return false;
 | 
				
			||||||
					if (ti.type != MP_HOUSE) goto do_clear;
 | 
										if (!IsTileType(cur_tile, MP_HOUSE)) goto do_clear;
 | 
				
			||||||
				} else if (type == IT_WATER_TOWER) {
 | 
									} else if (type == IT_WATER_TOWER) {
 | 
				
			||||||
					if (ti.type != MP_HOUSE) {
 | 
										if (!IsTileType(cur_tile, MP_HOUSE)) {
 | 
				
			||||||
						_error_message = STR_0316_CAN_ONLY_BE_BUILT_IN_TOWNS;
 | 
											_error_message = STR_0316_CAN_ONLY_BE_BUILT_IN_TOWNS;
 | 
				
			||||||
						return false;
 | 
											return false;
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user