Codechange: remove has_newhouses global

This commit is contained in:
Yexo 2020-05-29 22:31:14 +02:00 committed by Yexo
parent 1c0ba07c3c
commit a82572d0f5
4 changed files with 2 additions and 12 deletions

View File

@ -2384,8 +2384,6 @@ static ChangeInfoResult TownHouseChangeInfo(uint hid, int numinfo, int prop, Byt
if (!CargoSpec::Get(housespec->accepts_cargo[2])->IsValid()) {
housespec->cargo_acceptance[2] = 0;
}
_loaded_newgrf_features.has_newhouses = true;
break;
}
@ -8633,7 +8631,6 @@ void ResetNewGRFData()
_loaded_newgrf_features.has_2CC = false;
_loaded_newgrf_features.used_liveries = 1 << LS_DEFAULT;
_loaded_newgrf_features.has_newhouses = false;
_loaded_newgrf_features.has_newindustries = false;
_loaded_newgrf_features.shore = SHORE_REPLACE_NONE;
_loaded_newgrf_features.tram = TRAMWAY_REPLACE_DEPOT_NONE;

View File

@ -174,7 +174,6 @@ enum TramReplacement {
struct GRFLoadedFeatures {
bool has_2CC; ///< Set if any vehicle is loaded which uses 2cc (two company colours).
uint64 used_liveries; ///< Bitmask of #LiveryScheme used by the defined engines.
bool has_newhouses; ///< Set if there are any newhouses loaded.
bool has_newindustries; ///< Set if there are any newindustries loaded.
ShoreReplacement shore; ///< In which way shore sprites were replaced.
TramReplacement tram; ///< In which way tram depots were replaced.

View File

@ -108,8 +108,6 @@ void IncreaseBuildingCount(Town *t, HouseID house_id)
{
HouseClassID class_id = HouseSpec::Get(house_id)->class_id;
if (!_loaded_newgrf_features.has_newhouses) return;
t->cache.building_counts.id_count[house_id]++;
_building_counts.id_count[house_id]++;
@ -129,8 +127,6 @@ void DecreaseBuildingCount(Town *t, HouseID house_id)
{
HouseClassID class_id = HouseSpec::Get(house_id)->class_id;
if (!_loaded_newgrf_features.has_newhouses) return;
if (t->cache.building_counts.id_count[house_id] > 0) t->cache.building_counts.id_count[house_id]--;
if (_building_counts.id_count[house_id] > 0) _building_counts.id_count[house_id]--;

View File

@ -2492,8 +2492,7 @@ static bool BuildTownHouse(Town *t, TileIndex tile)
if (t->cache.building_counts.id_count[i] == UINT16_MAX) continue;
}
/* Without NewHouses, all houses have probability '1' */
uint cur_prob = (_loaded_newgrf_features.has_newhouses ? hs->probability : 1);
uint cur_prob = hs->probability;
probability_max += cur_prob;
probs[num] = cur_prob;
houses[num++] = (HouseID)i;
@ -2526,8 +2525,7 @@ static bool BuildTownHouse(Town *t, TileIndex tile)
const HouseSpec *hs = HouseSpec::Get(house);
if (_loaded_newgrf_features.has_newhouses && !_generating_world &&
_game_mode != GM_EDITOR && (hs->extra_flags & BUILDING_IS_HISTORICAL) != 0) {
if (!_generating_world && _game_mode != GM_EDITOR && (hs->extra_flags & BUILDING_IS_HISTORICAL) != 0) {
continue;
}