summaryrefslogtreecommitdiff
path: root/src/station.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/station.cpp
parented6084523d546641d4ec9ff5f560387d7c40670f (diff)
downloadopenttd-94b40fd530f8ef348434d14a1c85fde66e25c98a.tar.xz
Codechange: Convert IndustryVector to a std::set.
Diffstat (limited to 'src/station.cpp')
-rw-r--r--src/station.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/station.cpp b/src/station.cpp
index 04c5a66bd..2fc1bdb45 100644
--- a/src/station.cpp
+++ b/src/station.cpp
@@ -307,8 +307,8 @@ Rect Station::GetCatchmentRect() const
/** Rect and pointer to IndustryVector */
struct RectAndIndustryVector {
- Rect rect; ///< The rectangle to search the industries in.
- IndustryVector *industries_near; ///< The nearby industries.
+ Rect rect; ///< The rectangle to search the industries in.
+ IndustryList *industries_near; ///< The nearby industries.
};
/**
@@ -328,7 +328,7 @@ static bool FindIndustryToDeliver(TileIndex ind_tile, void *user_data)
Industry *ind = Industry::GetByTile(ind_tile);
/* Don't check further if this industry is already in the list */
- if (riv->industries_near->Contains(ind)) return false;
+ if (riv->industries_near->find(ind) != riv->industries_near->end()) return false;
/* Only process tiles in the station acceptance rectangle */
int x = TileX(ind_tile);
@@ -342,7 +342,7 @@ static bool FindIndustryToDeliver(TileIndex ind_tile, void *user_data)
}
if (cargo_index >= lengthof(ind->accepts_cargo)) return false;
- *riv->industries_near->Append() = ind;
+ riv->industries_near->insert(ind);
return false;
}
@@ -353,12 +353,12 @@ static bool FindIndustryToDeliver(TileIndex ind_tile, void *user_data)
*/
void Station::RecomputeIndustriesNear()
{
- this->industries_near.Clear();
+ this->industries_near.clear();
if (this->rect.IsEmpty()) return;
if (!_settings_game.station.serve_neutral_industries && this->industry != NULL) {
/* Station is associated with an industry, so we only need to deliver to that industry. */
- *this->industries_near.Append() = this->industry;
+ this->industries_near.insert(this->industry);
return;
}