diff options
author | glx <glx@openttd.org> | 2019-12-17 19:05:46 +0100 |
---|---|---|
committer | Niels Martin Hansen <nielsm@indvikleren.dk> | 2019-12-21 20:13:03 +0100 |
commit | 514565fad6d3a7e93a24b53b29eb901ef4f6a166 (patch) | |
tree | badaf632dd5047e6be442e606bee956184845479 /src/saveload/afterload.cpp | |
parent | 11f178a312d1a601aa14f9188f05f4a4cd033cf9 (diff) | |
download | openttd-514565fad6d3a7e93a24b53b29eb901ef4f6a166.tar.xz |
Codechange: Replace FOR_ALL_OBJECTS with range-based for loops
Diffstat (limited to 'src/saveload/afterload.cpp')
-rw-r--r-- | src/saveload/afterload.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index 8df01bc58..d175b612f 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -253,8 +253,7 @@ static void InitializeWindowsAndCaches() } /* Count number of objects per type */ - Object *o; - FOR_ALL_OBJECTS(o) { + for (Object *o : Object::Iterate()) { Object::IncTypeCount(o->type); } @@ -2474,8 +2473,7 @@ bool AfterLoadGame() /* Add (random) colour to all objects. */ if (IsSavegameVersionBefore(SLV_148)) { - Object *o; - FOR_ALL_OBJECTS(o) { + for (Object *o : Object::Iterate()) { Owner owner = GetTileOwner(o->location.tile); o->colour = (owner == OWNER_NONE) ? Random() & 0xF : Company::Get(owner)->livery->colour1; } |