Codechange: Replace FOR_ALL_OBJECTS with range-based for loops

This commit is contained in:
glx
2019-12-17 19:05:46 +01:00
committed by Niels Martin Hansen
parent 11f178a312
commit 514565fad6
6 changed files with 8 additions and 20 deletions

View File

@@ -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;
}