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

Function ClearMakeHouseTile

src/town_cmd.cpp:2541–2551  ·  view source on GitHub ↗

* Clears tile and builds a house or house part. * @param tile The tile to build upon. * @param t The town which will own the house. * @param counter The construction stage counter for the house. * @param stage The current construction stage of the house. * @param type The type of house. * @param random_bits Random bits for newgrf houses to use. * @param is_protected Whether the house is pro

Source from the content-addressed store, hash-verified

2539 * @pre The house can be built here.
2540 */
2541static inline void ClearMakeHouseTile(TileIndex tile, Town *t, uint8_t counter, uint8_t stage, HouseID type, uint8_t random_bits, bool is_protected)
2542{
2543 [[maybe_unused]] CommandCost cc = Command<CMD_LANDSCAPE_CLEAR>::Do({DoCommandFlag::Execute, DoCommandFlag::Auto, DoCommandFlag::NoWater}, tile);
2544 assert(cc.Succeeded());
2545
2546 IncreaseBuildingCount(t, type);
2547 MakeHouseTile(tile, t->index, counter, stage, type, random_bits, is_protected);
2548 if (HouseSpec::Get(type)->building_flags.Test(BuildingFlag::IsAnimated)) AddAnimatedTile(tile, false);
2549
2550 MarkTileDirtyByTile(tile);
2551}
2552
2553
2554/**

Callers 1

MakeTownHouseFunction · 0.85

Calls 6

IncreaseBuildingCountFunction · 0.85
MakeHouseTileFunction · 0.85
AddAnimatedTileFunction · 0.85
SucceededMethod · 0.80
TestMethod · 0.80
MarkTileDirtyByTileFunction · 0.70

Tested by

no test coverage detected