* Checks if a 1x2 or 2x1 building is allowed here, accounting for road layout and tile heights. * Also, tests both building positions that occupy this tile. * @param tile The tile where the building should be built. * @param t The town. * @param maxz The maximum Z level, since all tiles must have the same height. * @param noslope Are foundations disallowed for this house? * @param second The
| 2722 | * @param second The diagdir from the first tile to the second tile. |
| 2723 | */ |
| 2724 | static bool CheckTownBuild2House(TileIndex *tile, Town *t, int maxz, bool noslope, DiagDirection second, TownExpandModes modes) |
| 2725 | { |
| 2726 | /* 'tile' is already checked in BuildTownHouse() - CanBuildHouseHere() and slope test */ |
| 2727 | |
| 2728 | TileIndex tile2 = *tile + TileOffsByDiagDir(second); |
| 2729 | if (TownLayoutAllowsHouseHere(t, tile2, modes) && CheckBuildHouseSameZ(tile2, maxz, noslope)) return true; |
| 2730 | |
| 2731 | tile2 = *tile + TileOffsByDiagDir(ReverseDiagDir(second)); |
| 2732 | if (TownLayoutAllowsHouseHere(t, tile2, modes) && CheckBuildHouseSameZ(tile2, maxz, noslope)) { |
| 2733 | *tile = tile2; |
| 2734 | return true; |
| 2735 | } |
| 2736 | |
| 2737 | return false; |
| 2738 | } |
| 2739 | |
| 2740 | |
| 2741 | /** |
no test coverage detected