diff options
author | peter1138 <peter1138@openttd.org> | 2019-02-24 19:16:24 +0000 |
---|---|---|
committer | PeterN <peter@fuzzle.org> | 2019-03-09 16:33:47 +0000 |
commit | 94b40fd530f8ef348434d14a1c85fde66e25c98a (patch) | |
tree | 0c9bdb846d86e484077cf4d997422567b7599246 /src/economy.cpp | |
parent | ed6084523d546641d4ec9ff5f560387d7c40670f (diff) | |
download | openttd-94b40fd530f8ef348434d14a1c85fde66e25c98a.tar.xz |
Codechange: Convert IndustryVector to a std::set.
Diffstat (limited to 'src/economy.cpp')
-rw-r--r-- | src/economy.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/economy.cpp b/src/economy.cpp index 205064096..b02d4bd76 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -1044,8 +1044,9 @@ static uint DeliverGoodsToIndustry(const Station *st, CargoID cargo_type, uint n uint accepted = 0; - for (uint i = 0; i < st->industries_near.Length() && num_pieces != 0; i++) { - Industry *ind = st->industries_near[i]; + for (Industry *ind : st->industries_near) { + if (num_pieces == 0) break; + if (ind->index == source) continue; if (!_settings_game.station.serve_neutral_industries) { |