summaryrefslogtreecommitdiff
path: root/src/town_cmd.cpp
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2019-12-15 05:55:59 +0100
committerNiels Martin Hansen <nielsm@indvikleren.dk>2019-12-21 20:13:03 +0100
commitddabfed1cd3efa9ee229214207a60fc7cb3e0641 (patch)
tree824eddd3155d04363864731a43a6863cd7fbd2a3 /src/town_cmd.cpp
parent3a14cea068d130e11b5d9dde11d4451dd7dec453 (diff)
downloadopenttd-ddabfed1cd3efa9ee229214207a60fc7cb3e0641.tar.xz
Codechange: Replace station related FOR_ALL with range-based for loops
Diffstat (limited to 'src/town_cmd.cpp')
-rw-r--r--src/town_cmd.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp
index 6f907bc3c..2c7393ce5 100644
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -2872,8 +2872,7 @@ CommandCost CmdDeleteTown(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
if (t == nullptr) return CMD_ERROR;
/* Stations refer to towns. */
- const Station *st;
- FOR_ALL_STATIONS(st) {
+ for (const Station *st : Station::Iterate()) {
if (st->town == t) {
/* Non-oil rig stations are always a problem. */
if (!(st->facilities & FACIL_AIRPORT) || st->airport.type != AT_OILRIG) return CMD_ERROR;
@@ -3159,8 +3158,7 @@ static CommandCost TownActionBribe(Town *t, DoCommandFlag flags)
t->unwanted[_current_company] = 6;
/* set all close by station ratings to 0 */
- Station *st;
- FOR_ALL_STATIONS(st) {
+ for (Station *st : Station::Iterate()) {
if (st->town == t && st->owner == _current_company) {
for (CargoID i = 0; i < NUM_CARGO; i++) st->goods[i].rating = 0;
}