summaryrefslogtreecommitdiff
path: root/src/economy.cpp
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2019-12-17 22:04:09 +0100
committerNiels Martin Hansen <nielsm@indvikleren.dk>2019-12-21 20:13:03 +0100
commitee7a8eebca774666cd3625431a86dd05113b5e88 (patch)
tree7a7843a2ffae14db6e15933eb1bb29923945ddb0 /src/economy.cpp
parent0b489f99249a8c62ee3826e490ed17f29377581c (diff)
downloadopenttd-ee7a8eebca774666cd3625431a86dd05113b5e88.tar.xz
Codechange: Replace FOR_ALL_TOWNS with range-based for loops
Diffstat (limited to 'src/economy.cpp')
-rw-r--r--src/economy.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/economy.cpp b/src/economy.cpp
index 49fcddf26..256e94d5c 100644
--- a/src/economy.cpp
+++ b/src/economy.cpp
@@ -302,8 +302,6 @@ void ChangeOwnershipOfCompanyItems(Owner old_owner, Owner new_owner)
assert(old_owner != _local_company);
}
- Town *t;
-
assert(old_owner != new_owner);
{
@@ -357,7 +355,7 @@ void ChangeOwnershipOfCompanyItems(Owner old_owner, Owner new_owner)
if (new_owner == INVALID_OWNER) RebuildSubsidisedSourceAndDestinationCache();
/* Take care of rating and transport rights in towns */
- FOR_ALL_TOWNS(t) {
+ for (Town *t : Town::Iterate()) {
/* If a company takes over, give the ratings to that company. */
if (new_owner != INVALID_OWNER) {
if (HasBit(t->have_ratings, old_owner)) {