src/tunnelbridge_cmd.cpp
changeset 7899 3b6a66b414ec
parent 7885 4eb9b01e37ff
child 7968 a28a39028d4f
equal deleted inserted replaced
7898:fdc041ac5190 7899:3b6a66b414ec
   248 
   248 
   249 	tileh_start = GetTileSlope(tile_start, &z_start);
   249 	tileh_start = GetTileSlope(tile_start, &z_start);
   250 	tileh_end = GetTileSlope(tile_end, &z_end);
   250 	tileh_end = GetTileSlope(tile_end, &z_end);
   251 
   251 
   252 	if (IsSteepSlope(tileh_start)) z_start += TILE_HEIGHT;
   252 	if (IsSteepSlope(tileh_start)) z_start += TILE_HEIGHT;
   253 	if (HASBIT(BRIDGE_FULL_LEVELED_FOUNDATION, tileh_start)) {
   253 	if (HASBIT(BRIDGE_FULL_LEVELED_FOUNDATION, tileh_start)) z_start += TILE_HEIGHT;
   254 		z_start += TILE_HEIGHT;
       
   255 		tileh_start = SLOPE_FLAT;
       
   256 	}
       
   257 
   254 
   258 	if (IsSteepSlope(tileh_end)) z_end += TILE_HEIGHT;
   255 	if (IsSteepSlope(tileh_end)) z_end += TILE_HEIGHT;
   259 	if (HASBIT(BRIDGE_FULL_LEVELED_FOUNDATION, tileh_end)) {
   256 	if (HASBIT(BRIDGE_FULL_LEVELED_FOUNDATION, tileh_end)) z_end += TILE_HEIGHT;
   260 		z_end += TILE_HEIGHT;
       
   261 		tileh_end = SLOPE_FLAT;
       
   262 	}
       
   263 
   257 
   264 	if (z_start != z_end) return_cmd_error(STR_5009_LEVEL_LAND_OR_WATER_REQUIRED);
   258 	if (z_start != z_end) return_cmd_error(STR_5009_LEVEL_LAND_OR_WATER_REQUIRED);
   265 
   259 
   266 	/* Towns are not allowed to use bridges on slopes. */
   260 	/* Towns are not allowed to use bridges on slopes. */
   267 	allow_on_slopes = (!_is_old_ai_player
   261 	allow_on_slopes = (!_is_old_ai_player