Changeset - r24233:880f6f3cfe60
[Not reviewed]
master
0 4 0
Yexo - 4 years ago 2020-05-29 20:31:14
yexo@openttd.org
Codechange: remove has_newhouses global
4 files changed with 2 insertions and 12 deletions:
0 comments (0 inline, 0 general)
src/newgrf.cpp
Show inline comments
 
@@ -2384,8 +2384,6 @@ static ChangeInfoResult TownHouseChangeI
 
				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;
src/newgrf.h
Show inline comments
 
@@ -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.
src/newgrf_house.cpp
Show inline comments
 
@@ -108,8 +108,6 @@ void IncreaseBuildingCount(Town *t, Hous
 
{
 
	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, Hous
 
{
 
	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]--;
 

	
src/town_cmd.cpp
Show inline comments
 
@@ -2492,8 +2492,7 @@ static bool BuildTownHouse(Town *t, 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, 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;
 
		}
 

	
0 comments (0 inline, 0 general)