* Write house information into the map. For multi-tile houses, all tiles are marked. * @param town The town related to this house * @param t The tile to build on. If a multi-tile house, this is the northern-most tile. * @param counter The counter of the construction stage. * @param stage The current construction stage. * @param The type of house. * @param random_bits Random bits for newgrf h
| 2563 | * @pre The house can be built here. |
| 2564 | */ |
| 2565 | static void MakeTownHouse(TileIndex tile, Town *t, uint8_t counter, uint8_t stage, HouseID type, uint8_t random_bits, bool is_protected) |
| 2566 | { |
| 2567 | BuildingFlags size = HouseSpec::Get(type)->building_flags; |
| 2568 | |
| 2569 | ClearMakeHouseTile(tile, t, counter, stage, type, random_bits, is_protected); |
| 2570 | if (size.Any(BUILDING_2_TILES_Y)) ClearMakeHouseTile(tile + TileDiffXY(0, 1), t, counter, stage, ++type, random_bits, is_protected); |
| 2571 | if (size.Any(BUILDING_2_TILES_X)) ClearMakeHouseTile(tile + TileDiffXY(1, 0), t, counter, stage, ++type, random_bits, is_protected); |
| 2572 | if (size.Any(BUILDING_HAS_4_TILES)) ClearMakeHouseTile(tile + TileDiffXY(1, 1), t, counter, stage, ++type, random_bits, is_protected); |
| 2573 | |
| 2574 | ForAllStationsAroundTiles(TileArea(tile, size.Any(BUILDING_2_TILES_X) ? 2 : 1, size.Any(BUILDING_2_TILES_Y) ? 2 : 1), [t](Station *st, TileIndex) { |
| 2575 | t->stations_near.insert(st); |
| 2576 | return true; |
| 2577 | }); |
| 2578 | } |
| 2579 | |
| 2580 | |
| 2581 | /** |
no test coverage detected