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

Function CheckFree2x2Area

src/town_cmd.cpp:2631–2642  ·  view source on GitHub ↗

* Checks if a house of size 2x2 can be built at this tile. * @param tile The tile of the house's northernmost tile. * @param z The maximum tile z, so all tiles are the same height. * @param noslope Are foundations disallowed for this house? * @return true iff house can be built here. * @see CheckBuildHouseSameZ() */

Source from the content-addressed store, hash-verified

2629 * @see CheckBuildHouseSameZ()
2630 */
2631static bool CheckFree2x2Area(TileIndex tile, int z, bool noslope)
2632{
2633 /* we need to check this tile too because we can be at different tile now */
2634 if (!CheckBuildHouseSameZ(tile, z, noslope)) return false;
2635
2636 for (DiagDirection d = DIAGDIR_SE; d < DIAGDIR_END; d++) {
2637 tile += TileOffsByDiagDir(d);
2638 if (!CheckBuildHouseSameZ(tile, z, noslope)) return false;
2639 }
2640
2641 return true;
2642}
2643
2644
2645/**

Callers 1

CheckTownBuild2x2HouseFunction · 0.85

Calls 2

CheckBuildHouseSameZFunction · 0.85
TileOffsByDiagDirFunction · 0.85

Tested by

no test coverage detected