* Update the CompanyHQ to the state associated with the given score * @param tile The (northern) tile of the company HQ, or INVALID_TILE. * @param score The current (performance) score of the company. */
| 163 | * @param score The current (performance) score of the company. |
| 164 | */ |
| 165 | void UpdateCompanyHQ(TileIndex tile, uint score) |
| 166 | { |
| 167 | if (tile == INVALID_TILE) return; |
| 168 | |
| 169 | uint8_t val = 0; |
| 170 | if (score >= 170) val++; |
| 171 | if (score >= 350) val++; |
| 172 | if (score >= 520) val++; |
| 173 | if (score >= 720) val++; |
| 174 | |
| 175 | while (GetCompanyHQSize(tile) < val) { |
| 176 | IncreaseCompanyHQSize(tile); |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | /** |
| 181 | * Updates the colour of the object whenever a company changes. |
no test coverage detected