Merge branch 'openttd'
This commit is contained in:
@@ -80,7 +80,7 @@ void UpdateHousesAndTowns()
|
||||
}
|
||||
|
||||
/* Check for cases when a NewGRF has set a wrong house substitute type. */
|
||||
for (const auto t : Map::Iterate()) {
|
||||
for (const TileIndex &t : Map::Iterate()) {
|
||||
if (!IsTileType(t, MP_HOUSE)) continue;
|
||||
|
||||
HouseID house_type = GetCleanHouseType(t);
|
||||
@@ -88,13 +88,13 @@ void UpdateHousesAndTowns()
|
||||
if (t == north_tile) {
|
||||
const HouseSpec *hs = HouseSpec::Get(house_type);
|
||||
bool valid_house = true;
|
||||
if (hs->building_flags & TILE_SIZE_2x1) {
|
||||
if (hs->building_flags.Test(BuildingFlag::Size2x1)) {
|
||||
TileIndex tile = t + TileDiffXY(1, 0);
|
||||
if (!IsTileType(tile, MP_HOUSE) || GetCleanHouseType(tile) != house_type + 1) valid_house = false;
|
||||
} else if (hs->building_flags & TILE_SIZE_1x2) {
|
||||
} else if (hs->building_flags.Test(BuildingFlag::Size1x2)) {
|
||||
TileIndex tile = t + TileDiffXY(0, 1);
|
||||
if (!IsTileType(tile, MP_HOUSE) || GetCleanHouseType(tile) != house_type + 1) valid_house = false;
|
||||
} else if (hs->building_flags & TILE_SIZE_2x2) {
|
||||
} else if (hs->building_flags.Test(BuildingFlag::Size2x2)) {
|
||||
TileIndex tile = t + TileDiffXY(0, 1);
|
||||
if (!IsTileType(tile, MP_HOUSE) || GetCleanHouseType(tile) != house_type + 1) valid_house = false;
|
||||
tile = t + TileDiffXY(1, 0);
|
||||
@@ -321,10 +321,10 @@ struct CITYChunkHandler : ChunkHandler {
|
||||
int index;
|
||||
|
||||
while ((index = SlIterateArray()) != -1) {
|
||||
Town *t = new (index) Town();
|
||||
Town *t = new (TownID(index)) Town();
|
||||
SlObject(t, slt);
|
||||
|
||||
if (t->townnamegrfid == 0 && !IsInsideMM(t->townnametype, SPECSTR_TOWNNAME_START, SPECSTR_TOWNNAME_LAST + 1) && GetStringTab(t->townnametype) != TEXT_TAB_OLD_CUSTOM) {
|
||||
if (t->townnamegrfid == 0 && !IsInsideMM(t->townnametype, SPECSTR_TOWNNAME_START, SPECSTR_TOWNNAME_END) && GetStringTab(t->townnametype) != TEXT_TAB_OLD_CUSTOM) {
|
||||
SlErrorCorrupt("Invalid town name generator");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user