src/station_cmd.cpp
branchNewGRF_ports
changeset 10994 cd9968b6f96b
parent 10991 d8811e327d12
child 10995 311b38c7f9a7
equal deleted inserted replaced
10991:d8811e327d12 10994:cd9968b6f96b
  1100 		}
  1100 		}
  1101 
  1101 
  1102 		tile_delta = (axis == AXIS_X ? TileDiffXY(1, 0) : TileDiffXY(0, 1));
  1102 		tile_delta = (axis == AXIS_X ? TileDiffXY(1, 0) : TileDiffXY(0, 1));
  1103 		track = AxisToTrack(axis);
  1103 		track = AxisToTrack(axis);
  1104 
  1104 
  1105 		layout_ptr = (byte*)alloca(numtracks * plat_len);
  1105 		layout_ptr = AllocaM(byte, numtracks * plat_len);
  1106 		GetStationLayout(layout_ptr, numtracks, plat_len, statspec);
  1106 		GetStationLayout(layout_ptr, numtracks, plat_len, statspec);
  1107 
  1107 
  1108 		numtracks_orig = numtracks;
  1108 		numtracks_orig = numtracks;
  1109 
  1109 
  1110 		do {
  1110 		do {
  1582  * @param p2 bit 0: 0 for Bus stops, 1 for truck stops
  1582  * @param p2 bit 0: 0 for Bus stops, 1 for truck stops
  1583  */
  1583  */
  1584 CommandCost CmdRemoveRoadStop(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
  1584 CommandCost CmdRemoveRoadStop(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
  1585 {
  1585 {
  1586 	/* Make sure the specified tile is a road stop of the correct type */
  1586 	/* Make sure the specified tile is a road stop of the correct type */
  1587 	if (!IsTileType(tile, MP_STATION) || !IsRoadStop(tile) || (uint32)GetRoadStopType(tile) != p2) return CMD_ERROR;
  1587 	if (!IsTileType(tile, MP_STATION) || !IsRoadStop(tile) || (uint32)GetRoadStopType(tile) != GB(p2, 0, 1)) return CMD_ERROR;
  1588 	Station *st = GetStationByTile(tile);
  1588 	Station *st = GetStationByTile(tile);
  1589 	/* Save the stop info before it is removed */
  1589 	/* Save the stop info before it is removed */
  1590 	bool is_drive_through = IsDriveThroughStopTile(tile);
  1590 	bool is_drive_through = IsDriveThroughStopTile(tile);
  1591 	RoadTypes rts = GetRoadTypes(tile);
  1591 	RoadTypes rts = GetRoadTypes(tile);
  1592 	RoadBits road_bits = IsDriveThroughStopTile(tile) ?
  1592 	RoadBits road_bits = IsDriveThroughStopTile(tile) ?