File diff r25450:7e9533370994 → r25451:917146b539af
src/station_cmd.cpp
Show inline comments
 
@@ -105,7 +105,7 @@ CommandCost GetStationAround(TileArea ta
 
	ta.Expand(1);
 

	
 
	/* check around to see if there are any stations there owned by the company */
 
	TILE_AREA_LOOP(tile_cur, ta) {
 
	for (TileIndex tile_cur : ta) {
 
		if (IsTileType(tile_cur, MP_STATION)) {
 
			StationID t = GetStationIndex(tile_cur);
 
			if (!T::IsValidID(t) || Station::Get(t)->owner != company) continue;
 
@@ -511,7 +511,7 @@ CargoArray GetProductionAroundTiles(Tile
 

	
 
	/* Loop over all tiles to get the produced cargo of
 
	 * everything except industries */
 
	TILE_AREA_LOOP(tile, ta) {
 
	for (TileIndex tile : ta) {
 
		if (IsTileType(tile, MP_INDUSTRY)) industries.insert(GetIndustryIndex(tile));
 
		AddProducedCargo(tile, produced);
 
	}
 
@@ -549,7 +549,7 @@ CargoArray GetAcceptanceAroundTiles(Tile
 

	
 
	TileArea ta = TileArea(tile, w, h).Expand(rad);
 

	
 
	TILE_AREA_LOOP(tile, ta) {
 
	for (TileIndex tile : ta) {
 
		/* Ignore industry if it has a neutral station. */
 
		if (!_settings_game.station.serve_neutral_industries && IsTileType(tile, MP_INDUSTRY) && Industry::GetByTile(tile)->neutral_station != nullptr) continue;
 

	
 
@@ -872,7 +872,7 @@ static CommandCost CheckFlatLandRailStat
 
	const StationSpec *statspec = StationClass::Get(spec_class)->GetSpec(spec_index);
 
	bool slope_cb = statspec != nullptr && HasBit(statspec->callback_mask, CBM_STATION_SLOPE_CHECK);
 

	
 
	TILE_AREA_LOOP(tile_cur, tile_area) {
 
	for (TileIndex tile_cur : tile_area) {
 
		CommandCost ret = CheckBuildableTile(tile_cur, invalid_dirs, allowed_z, false);
 
		if (ret.Failed()) return ret;
 
		cost.AddCost(ret);
 
@@ -954,7 +954,7 @@ static CommandCost CheckFlatLandRoadStop
 
	CommandCost cost(EXPENSES_CONSTRUCTION);
 
	int allowed_z = -1;
 

	
 
	TILE_AREA_LOOP(cur_tile, tile_area) {
 
	for (TileIndex cur_tile : tile_area) {
 
		CommandCost ret = CheckBuildableTile(cur_tile, invalid_dirs, allowed_z, !is_drive_through);
 
		if (ret.Failed()) return ret;
 
		cost.AddCost(ret);
 
@@ -1435,7 +1435,7 @@ CommandCost CmdBuildRailStation(TileInde
 
			update_reservation_area = TileArea(tile_org, numtracks_orig, 1);
 
		}
 

	
 
		TILE_AREA_LOOP(tile, update_reservation_area) {
 
		for (TileIndex tile : update_reservation_area) {
 
			/* Don't even try to make eye candy parts reserved. */
 
			if (IsStationTileBlocked(tile)) continue;
 

	
 
@@ -1563,7 +1563,7 @@ CommandCost RemoveFromRailBaseStation(Ti
 
	CommandCost error;
 

	
 
	/* Do the action for every tile into the area */
 
	TILE_AREA_LOOP(tile, ta) {
 
	for (TileIndex tile : ta) {
 
		/* Make sure the specified tile is a rail station */
 
		if (!HasStationTileRail(tile)) continue;
 

	
 
@@ -1729,7 +1729,7 @@ CommandCost RemoveRailStation(T *st, DoC
 

	
 
	CommandCost cost(EXPENSES_CONSTRUCTION);
 
	/* clear all areas of the station */
 
	TILE_AREA_LOOP(tile, ta) {
 
	for (TileIndex tile : ta) {
 
		/* only remove tiles that are actually train station tiles */
 
		if (st->TileBelongsToRailStation(tile)) {
 
			std::vector<T*> affected_stations; // dummy
 
@@ -1894,7 +1894,7 @@ CommandCost CmdBuildRoadStop(TileIndex t
 

	
 
	if (flags & DC_EXEC) {
 
		/* Check every tile in the area. */
 
		TILE_AREA_LOOP(cur_tile, roadstop_area) {
 
		for (TileIndex cur_tile : roadstop_area) {
 
			/* Get existing road types and owners before any tile clearing */
 
			RoadType road_rt = MayHaveRoad(cur_tile) ? GetRoadType(cur_tile, RTT_ROAD) : INVALID_ROADTYPE;
 
			RoadType tram_rt = MayHaveRoad(cur_tile) ? GetRoadType(cur_tile, RTT_TRAM) : INVALID_ROADTYPE;
 
@@ -2101,7 +2101,7 @@ CommandCost CmdRemoveRoadStop(TileIndex 
 
	CommandCost last_error(STR_ERROR_THERE_IS_NO_STATION);
 
	bool had_success = false;
 

	
 
	TILE_AREA_LOOP(cur_tile, roadstop_area) {
 
	for (TileIndex cur_tile : roadstop_area) {
 
		/* Make sure the specified tile is a road stop of the correct type */
 
		if (!IsTileType(cur_tile, MP_STATION) || !IsRoadStop(cur_tile) || (uint32)GetRoadStopType(cur_tile) != GB(p2, 0, 1)) continue;
 

	
 
@@ -2409,7 +2409,7 @@ static CommandCost RemoveAirport(TileInd
 
		nearest->noise_reached -= GetAirportNoiseLevelForDistance(as, dist);
 
	}
 

	
 
	TILE_AREA_LOOP(tile_cur, st->airport) {
 
	for (TileIndex tile_cur : st->airport) {
 
		if (!st->TileBelongsToAirport(tile_cur)) continue;
 

	
 
		CommandCost ret = EnsureNoVehicleOnGround(tile_cur);
 
@@ -4120,7 +4120,7 @@ void UpdateStationDockingTiles(Station *
 
	int y1 = std::max<int>(y - 1, 0);
 

	
 
	TileArea ta(TileXY(x1, y1), TileXY(x2 - 1, y2 - 1));
 
	TILE_AREA_LOOP(tile, ta) {
 
	for (TileIndex tile : ta) {
 
		if (IsValidTile(tile) && IsPossibleDockingTile(tile)) CheckForDockingTile(tile);
 
	}
 
}