summaryrefslogtreecommitdiff
path: root/src/economy.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-07-01 17:43:26 +0000
committersmatz <smatz@openttd.org>2009-07-01 17:43:26 +0000
commitf4d0d94184ba53d4c5d1343b69bb05e7fa735bff (patch)
treedea54822153f6e578140cbdd847bc5f4ed864230 /src/economy.cpp
parent023f78b5ff76b15777d6d7db73adcb9a6673c543 (diff)
downloadopenttd-f4d0d94184ba53d4c5d1343b69bb05e7fa735bff.tar.xz
(svn r16711) -Codechange: use FOR_ALL_SUBSIDIES macro when iterating over all subsidies
Diffstat (limited to 'src/economy.cpp')
-rw-r--r--src/economy.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/economy.cpp b/src/economy.cpp
index 0891e1bd9..2883f65c1 100644
--- a/src/economy.cpp
+++ b/src/economy.cpp
@@ -327,10 +327,9 @@ void ChangeOwnershipOfCompanyItems(Owner old_owner, Owner new_owner)
if (new_owner == INVALID_OWNER) {
Subsidy *s;
-
- for (s = _subsidies; s != endof(_subsidies); s++) {
- if (s->cargo_type != CT_INVALID && s->age >= 12) {
- if (Station::Get(s->to)->owner == old_owner) s->cargo_type = CT_INVALID;
+ FOR_ALL_SUBSIDIES(s) {
+ if (s->age >= 12 && Station::Get(s->to)->owner == old_owner) {
+ s->cargo_type = CT_INVALID;
}
}
}