|
@@ -1926,17 +1926,12 @@ static bool BuildTownHouse(Town *t, Tile
|
|
|
if (hs->override != 0) {
|
|
|
house = hs->override;
|
|
|
hs = GetHouseSpecs(house);
|
|
|
}
|
|
|
|
|
|
if ((hs->extra_flags & BUILDING_IS_HISTORICAL) && !_generating_world) continue;
|
|
|
|
|
|
if (HasBit(hs->callback_mask, CBM_HOUSE_ALLOW_CONSTRUCTION)) {
|
|
|
uint16 callback_res = GetHouseCallback(CBID_HOUSE_ALLOW_CONSTRUCTION, 0, 0, house, t, tile);
|
|
|
if (callback_res != CALLBACK_FAILED && GB(callback_res, 0, 8) == 0) continue;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (_cur_year < hs->min_year || _cur_year > hs->max_year) continue;
|
|
|
|
|
|
/* Special houses that there can be only one of. */
|
|
|
uint oneof = 0;
|
|
@@ -1944,13 +1939,13 @@ static bool BuildTownHouse(Town *t, Tile
|
|
|
if (hs->building_flags & BUILDING_IS_CHURCH) {
|
|
|
SetBit(oneof, TOWN_HAS_CHURCH);
|
|
|
} else if (hs->building_flags & BUILDING_IS_STADIUM) {
|
|
|
SetBit(oneof, TOWN_HAS_STADIUM);
|
|
|
}
|
|
|
|
|
|
if (HASBITS(t->flags12 , oneof)) continue;
|
|
|
if (HASBITS(t->flags12, oneof)) continue;
|
|
|
|
|
|
/* Make sure there is no slope? */
|
|
|
bool noslope = (hs->building_flags & TILE_NOT_SLOPED) != 0;
|
|
|
if (noslope && slope != SLOPE_FLAT) continue;
|
|
|
|
|
|
if (hs->building_flags & TILE_SIZE_2x2) {
|
|
@@ -1960,12 +1955,17 @@ static bool BuildTownHouse(Town *t, Tile
|
|
|
} else if (hs->building_flags & TILE_SIZE_1x2) {
|
|
|
if (!CheckTownBuild2House(&tile, t, maxz, noslope, DIAGDIR_SE)) continue;
|
|
|
} else {
|
|
|
/* 1x1 house checks are already done */
|
|
|
}
|
|
|
|
|
|
if (HasBit(hs->callback_mask, CBM_HOUSE_ALLOW_CONSTRUCTION)) {
|
|
|
uint16 callback_res = GetHouseCallback(CBID_HOUSE_ALLOW_CONSTRUCTION, 0, 0, house, t, tile);
|
|
|
if (callback_res != CALLBACK_FAILED && GB(callback_res, 0, 8) == 0) continue;
|
|
|
}
|
|
|
|
|
|
/* build the house */
|
|
|
t->num_houses++;
|
|
|
IncreaseBuildingCount(t, house);
|
|
|
|
|
|
/* Special houses that there can be only one of. */
|
|
|
t->flags12 |= oneof;
|