* Helper function for house construction stage progression. * @param tile TileIndex of the house (or parts of it) to construct. */
| 491 | * @param tile TileIndex of the house (or parts of it) to construct. |
| 492 | */ |
| 493 | static void AdvanceSingleHouseConstruction(TileIndex tile) |
| 494 | { |
| 495 | assert(IsTileType(tile, MP_HOUSE)); |
| 496 | |
| 497 | /* Progress in construction stages */ |
| 498 | IncHouseConstructionTick(tile); |
| 499 | if (GetHouseConstructionTick(tile) != 0) return; |
| 500 | |
| 501 | TriggerHouseAnimation_ConstructionStageChanged(tile, false); |
| 502 | |
| 503 | if (IsHouseCompleted(tile)) { |
| 504 | /* Now that construction is complete, we can add the population of the |
| 505 | * building to the town. */ |
| 506 | ChangePopulation(Town::GetByTile(tile), HouseSpec::Get(GetHouseType(tile))->population); |
| 507 | ResetHouseAge(tile); |
| 508 | } |
| 509 | MarkTileDirtyByTile(tile); |
| 510 | } |
| 511 | |
| 512 | /** |
| 513 | * Increase the construction stage of a house. |
no test coverage detected