summaryrefslogtreecommitdiff
path: root/src/station_cmd.cpp
diff options
context:
space:
mode:
authorHenry Wilson <m3henry@googlemail.com>2019-03-03 17:30:09 +0000
committerPeterN <peter@fuzzle.org>2019-03-26 20:15:57 +0000
commitc01a2e2a81d8e7bcd47d46292ed0b7d452081c31 (patch)
treeb38441ec8469136a6a2252f8c856d22f14ee689e /src/station_cmd.cpp
parent6570f7989f5c1fc5a1276505a8e6efce7838efd9 (diff)
downloadopenttd-c01a2e2a81d8e7bcd47d46292ed0b7d452081c31.tar.xz
Codechange: Removed SmallVector completely
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r--src/station_cmd.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 63e3384b0..5dfba2d19 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -887,7 +887,7 @@ static CommandCost CheckFlatLandAirport(AirportTileTableIterator tile_iter, DoCo
* @param numtracks Number of platforms.
* @return The cost in case of success, or an error code if it failed.
*/
-static CommandCost CheckFlatLandRailStation(TileArea tile_area, DoCommandFlag flags, Axis axis, StationID *station, RailType rt, SmallVector<Train *, 4> &affected_vehicles, StationClassID spec_class, byte spec_index, byte plat_len, byte numtracks)
+static CommandCost CheckFlatLandRailStation(TileArea tile_area, DoCommandFlag flags, Axis axis, StationID *station, RailType rt, std::vector<Train *> &affected_vehicles, StationClassID spec_class, byte spec_index, byte plat_len, byte numtracks)
{
CommandCost cost(EXPENSES_CONSTRUCTION);
int allowed_z = -1;
@@ -1310,7 +1310,7 @@ CommandCost CmdBuildRailStation(TileIndex tile_org, DoCommandFlag flags, uint32
/* Make sure the area below consists of clear tiles. (OR tiles belonging to a certain rail station) */
StationID est = INVALID_STATION;
- SmallVector<Train *, 4> affected_vehicles;
+ std::vector<Train *> affected_vehicles;
/* Clear the land below the station. */
CommandCost cost = CheckFlatLandRailStation(new_location, flags, axis, &est, rt, affected_vehicles, spec_class, spec_index, plat_len, numtracks);
if (cost.Failed()) return cost;
@@ -1547,7 +1547,7 @@ restart:
* @return the number of cleared tiles or an error.
*/
template <class T>
-CommandCost RemoveFromRailBaseStation(TileArea ta, SmallVector<T *, 4> &affected_stations, DoCommandFlag flags, Money removal_cost, bool keep_rail)
+CommandCost RemoveFromRailBaseStation(TileArea ta, std::vector<T *> &affected_stations, DoCommandFlag flags, Money removal_cost, bool keep_rail)
{
/* Count of the number of tiles removed */
int quantity = 0;
@@ -1660,7 +1660,7 @@ CommandCost CmdRemoveFromRailStation(TileIndex start, DoCommandFlag flags, uint3
if (start >= MapSize() || end >= MapSize()) return CMD_ERROR;
TileArea ta(start, end);
- SmallVector<Station *, 4> affected_stations;
+ std::vector<Station *> affected_stations;
CommandCost ret = RemoveFromRailBaseStation(ta, affected_stations, flags, _price[PR_CLEAR_STATION_RAIL], HasBit(p2, 0));
if (ret.Failed()) return ret;
@@ -1694,7 +1694,7 @@ CommandCost CmdRemoveFromRailWaypoint(TileIndex start, DoCommandFlag flags, uint
if (start >= MapSize() || end >= MapSize()) return CMD_ERROR;
TileArea ta(start, end);
- SmallVector<Waypoint *, 4> affected_stations;
+ std::vector<Waypoint *> affected_stations;
return RemoveFromRailBaseStation(ta, affected_stations, flags, _price[PR_CLEAR_WAYPOINT_RAIL], HasBit(p2, 0));
}
@@ -1727,7 +1727,7 @@ CommandCost RemoveRailStation(T *st, DoCommandFlag flags, Money removal_cost)
TILE_AREA_LOOP(tile, ta) {
/* only remove tiles that are actually train station tiles */
if (st->TileBelongsToRailStation(tile)) {
- SmallVector<T*, 4> affected_stations; // dummy
+ std::vector<T*> affected_stations; // dummy
CommandCost ret = RemoveFromRailBaseStation(TileArea(tile, 1, 1), affected_stations, flags, removal_cost, false);
if (ret.Failed()) return ret;
cost.AddCost(ret);
@@ -3521,7 +3521,7 @@ void DeleteStaleLinks(Station *from)
/* Have all vehicles refresh their next hops before deciding to
* remove the node. */
OrderList *l;
- SmallVector<Vehicle *, 32> vehicles;
+ std::vector<Vehicle *> vehicles;
FOR_ALL_ORDER_LISTS(l) {
bool found_from = false;
bool found_to = false;