MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / AdvanceHouseConstruction

Function AdvanceHouseConstruction

src/town_cmd.cpp:516–523  ·  view source on GitHub ↗

* Increase the construction stage of a house. * @param tile The tile of the house under construction. */

Source from the content-addressed store, hash-verified

514 * @param tile The tile of the house under construction.
515 */
516static void AdvanceHouseConstruction(TileIndex tile)
517{
518 BuildingFlags flags = HouseSpec::Get(GetHouseType(tile))->building_flags;
519 if (flags.Any(BUILDING_HAS_1_TILE)) AdvanceSingleHouseConstruction(TileAddXY(tile, 0, 0));
520 if (flags.Any(BUILDING_2_TILES_Y)) AdvanceSingleHouseConstruction(TileAddXY(tile, 0, 1));
521 if (flags.Any(BUILDING_2_TILES_X)) AdvanceSingleHouseConstruction(TileAddXY(tile, 1, 0));
522 if (flags.Any(BUILDING_HAS_4_TILES)) AdvanceSingleHouseConstruction(TileAddXY(tile, 1, 1));
523}
524
525/**
526 * Generate cargo for a house, scaled by the current economy scale.

Callers 1

TileLoop_TownFunction · 0.85

Calls 4

GetHouseTypeFunction · 0.85
TileAddXYFunction · 0.85
AnyMethod · 0.80

Tested by

no test coverage detected