(svn r20658) -Codechange: add the colour of an object to the object instance

This commit is contained in:
rubidium
2010-08-28 18:28:34 +00:00
parent b376f8ae15
commit e0ba6550d2
4 changed files with 29 additions and 6 deletions

View File

@@ -2279,6 +2279,15 @@ bool AfterLoadGame()
}
}
/* Add (random) colour to all objects. */
if (CheckSavegameVersion(148)) {
Object *o;
FOR_ALL_OBJECTS(o) {
Owner owner = GetTileOwner(o->location.tile);
o->colour = (owner == OWNER_NONE) ? Random() & 0xF : Company::Get(owner)->livery->colour1;
}
}
/* Road stops is 'only' updating some caches */
AfterLoadRoadStops();
AfterLoadLabelMaps();