summaryrefslogtreecommitdiff
path: root/src/industry_cmd.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2019-02-24 19:16:24 +0000
committerPeterN <peter@fuzzle.org>2019-03-09 16:33:47 +0000
commit94b40fd530f8ef348434d14a1c85fde66e25c98a (patch)
tree0c9bdb846d86e484077cf4d997422567b7599246 /src/industry_cmd.cpp
parented6084523d546641d4ec9ff5f560387d7c40670f (diff)
downloadopenttd-94b40fd530f8ef348434d14a1c85fde66e25c98a.tar.xz
Codechange: Convert IndustryVector to a std::set.
Diffstat (limited to 'src/industry_cmd.cpp')
-rw-r--r--src/industry_cmd.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp
index cc05893fb..b1e48f76b 100644
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -521,7 +521,7 @@ static bool TransportIndustryGoods(TileIndex tile)
if (i->neutral_station != NULL && !_settings_game.station.serve_neutral_industries) {
/* Industry has a neutral station. Use it and ignore any other nearby stations. */
- *neutral.Append() = i->neutral_station;
+ neutral.insert(i->neutral_station);
}
for (uint j = 0; j < lengthof(i->produced_cargo_waiting); j++) {
@@ -534,7 +534,7 @@ static bool TransportIndustryGoods(TileIndex tile)
i->this_month_production[j] += cw;
- uint am = MoveGoodsToStation(i->produced_cargo[j], cw, ST_INDUSTRY, i->index, neutral.Length() != 0 ? &neutral : stations.GetStations());
+ uint am = MoveGoodsToStation(i->produced_cargo[j], cw, ST_INDUSTRY, i->index, neutral.size() != 0 ? &neutral : stations.GetStations());
i->this_month_transported[j] += am;
moved_cargo |= (am != 0);
@@ -2907,3 +2907,8 @@ extern const TileTypeProcs _tile_type_industry_procs = {
GetFoundation_Industry, // get_foundation_proc
TerraformTile_Industry, // terraform_tile_proc
};
+
+bool IndustryCompare::operator() (const Industry *lhs, const Industry *rhs) const
+{
+ return lhs->index < rhs->index;
+}