src/industry_cmd.cpp
branch0.6
changeset 10801 3ad9dfb5430d
parent 10655 b862a4add8b0
equal deleted inserted replaced
10659:2d983c15a049 10801:3ad9dfb5430d
   328 	return GetTileMaxZ(tile);
   328 	return GetTileMaxZ(tile);
   329 }
   329 }
   330 
   330 
   331 static Foundation GetFoundation_Industry(TileIndex tile, Slope tileh)
   331 static Foundation GetFoundation_Industry(TileIndex tile, Slope tileh)
   332 {
   332 {
       
   333 	IndustryGfx gfx = GetIndustryGfx(tile);
       
   334 
       
   335 	/* For NewGRF industry tiles we might not be drawing a foundation. We need to
       
   336 	 * account for this, otherwise we might be applying a FOUNDATION_LEVELED
       
   337 	 * on a steep slope which is not allowed. Furthermore other structures should
       
   338 	 * draw the wall of the foundation in this case.
       
   339 	 */
       
   340 	if (gfx >= NEW_INDUSTRYTILEOFFSET) {
       
   341 		const IndustryTileSpec *indts = GetIndustryTileSpec(gfx);
       
   342 		if (indts->grf_prop.spritegroup != NULL && HasBit(indts->callback_flags, CBM_INDT_DRAW_FOUNDATIONS)) {
       
   343 			uint32 callback_res = GetIndustryTileCallback(CBID_INDUSTRY_DRAW_FOUNDATIONS, 0, 0, gfx, GetIndustryByTile(tile), tile);
       
   344 			if (callback_res == 0) return FOUNDATION_NONE;
       
   345 		}
       
   346 	}
   333 	return FlatteningFoundation(tileh);
   347 	return FlatteningFoundation(tileh);
   334 }
   348 }
   335 
   349 
   336 static void GetAcceptedCargo_Industry(TileIndex tile, AcceptedCargo ac)
   350 static void GetAcceptedCargo_Industry(TileIndex tile, AcceptedCargo ac)
   337 {
   351 {