* Updates the colour of the object whenever a company changes. * @param c The company the company colour changed of. */
| 182 | * @param c The company the company colour changed of. |
| 183 | */ |
| 184 | void UpdateObjectColours(const Company *c) |
| 185 | { |
| 186 | for (Object *obj : Object::Iterate()) { |
| 187 | Owner owner = GetTileOwner(obj->location.tile); |
| 188 | /* Not the current owner, so colour doesn't change. */ |
| 189 | if (owner != c->index) continue; |
| 190 | |
| 191 | const ObjectSpec *spec = ObjectSpec::GetByTile(obj->location.tile); |
| 192 | /* Using the object colour callback, so not using company colour. */ |
| 193 | if (spec->callback_mask.Test(ObjectCallbackMask::Colour)) continue; |
| 194 | |
| 195 | obj->colour = c->GetCompanyRecolourOffset(LS_DEFAULT, spec->flags.Test(ObjectFlag::Uses2CC)); |
| 196 | } |
| 197 | } |
| 198 | |
| 199 | extern CommandCost CheckBuildableTile(TileIndex tile, DiagDirections invalid_dirs, int &allowed_z, bool allow_steep, bool check_bridge); |
| 200 | static CommandCost ClearTile_Object(TileIndex tile, DoCommandFlags flags); |
no test coverage detected