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

Function CheckBuildHouseSameZ

src/town_cmd.cpp:2612–2620  ·  view source on GitHub ↗

* Check if a tile where we want to build a multi-tile house has an appropriate max Z. * @param tile The tile to check. * @param z The max Z level to allow. * @param noslope Are foundations disallowed for this house? * @return true iff house can be built here. * @see CanBuildHouseHere() */

Source from the content-addressed store, hash-verified

2610 * @see CanBuildHouseHere()
2611 */
2612static inline bool CheckBuildHouseSameZ(TileIndex tile, int z, bool noslope)
2613{
2614 if (!CanBuildHouseHere(tile, noslope)) return false;
2615
2616 /* if building on slopes is allowed, there will be flattening foundation (to tile max z) */
2617 if (GetTileMaxZ(tile) != z) return false;
2618
2619 return true;
2620}
2621
2622
2623/**

Callers 2

CheckFree2x2AreaFunction · 0.85
CheckTownBuild2HouseFunction · 0.85

Calls 2

CanBuildHouseHereFunction · 0.85
GetTileMaxZFunction · 0.85

Tested by

no test coverage detected