forked from mirror/OpenTTD
(svn r10005) -Codechange: Merge two flags (2cc and newhouses) indicating some newgrf features have been loaded, and introduce the newindustry one.
This commit is contained in:
@@ -1668,7 +1668,7 @@ static void DoBuildTownHouse(Town *t, TileIndex tile)
|
||||
for (i = 0; i < HOUSE_MAX; i++) {
|
||||
hs = GetHouseSpecs(i);
|
||||
if ((~hs->building_availability & bitmask) == 0 && hs->enabled) {
|
||||
if (_have_newhouses) {
|
||||
if (HASBIT(_loaded_newgrf_features, GRFLOADED_NEWHOUSES)) {
|
||||
probability_max += hs->probability;
|
||||
cumulative_probs[num] = probability_max;
|
||||
}
|
||||
@@ -1677,7 +1677,7 @@ static void DoBuildTownHouse(Town *t, TileIndex tile)
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
if (_have_newhouses) {
|
||||
if (HASBIT(_loaded_newgrf_features, GRFLOADED_NEWHOUSES)) {
|
||||
uint r = RandomRange(probability_max);
|
||||
for (i = 0; i < num; i++) if (cumulative_probs[i] >= r) break;
|
||||
|
||||
@@ -1688,7 +1688,7 @@ static void DoBuildTownHouse(Town *t, TileIndex tile)
|
||||
|
||||
hs = GetHouseSpecs(house);
|
||||
|
||||
if (_have_newhouses) {
|
||||
if (HASBIT(_loaded_newgrf_features, GRFLOADED_NEWHOUSES)) {
|
||||
if (hs->override != 0) hs = GetHouseSpecs(hs->override);
|
||||
|
||||
if ((hs->extra_flags & BUILDING_IS_HISTORICAL) && !_generating_world) continue;
|
||||
|
Reference in New Issue
Block a user