Changeset - r18238:3e9a69b42b81
[Not reviewed]
master
0 8 0
rubidium - 13 years ago 2011-11-03 22:49:03
rubidium@openttd.org
(svn r23084) -Codechange: get rid of a redundant variable
8 files changed with 15 insertions and 22 deletions:
0 comments (0 inline, 0 general)
src/clear_cmd.cpp
Show inline comments
 
@@ -358,17 +358,12 @@ static void GetTileDesc_Clear(TileIndex 
 

	
 
static void ChangeTileOwner_Clear(TileIndex tile, Owner old_owner, Owner new_owner)
 
{
 
	return;
 
}
 

	
 
void InitializeClearLand()
 
{
 
	_settings_game.game_creation.snow_line = _settings_game.game_creation.snow_line_height * TILE_HEIGHT;
 
}
 

	
 
static CommandCost TerraformTile_Clear(TileIndex tile, DoCommandFlag flags, uint z_new, Slope tileh_new)
 
{
 
	return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
 
}
 

	
 
extern const TileTypeProcs _tile_type_clear_procs = {
src/landscape.cpp
Show inline comments
 
@@ -76,13 +76,13 @@ extern const byte _slope_to_sprite_offse
 
	0, 0, 0, 0, 0, 0, 0, 16, 0, 0,  0, 17,  0, 15, 18, 0,
 
};
 

	
 
/**
 
 * Description of the snow line throughout the year.
 
 *
 
 * If it is \c NULL, a static snowline height is used, as set by \c _settings_game.game_creation.snow_line.
 
 * If it is \c NULL, a static snowline height is used, as set by \c _settings_game.game_creation.snow_line_height.
 
 * Otherwise it points to a table loaded from a newGRF file that describes the variable snowline.
 
 * @ingroup SnowLineGroup
 
 * @see GetSnowLine() GameCreationSettings
 
 */
 
static SnowLine *_snow_line = NULL;
 

	
 
@@ -558,13 +558,13 @@ void SetSnowLine(byte table[SNOW_LINE_MO
 
 * Get the current snow line, either variable or static.
 
 * @return the snow line height.
 
 * @ingroup SnowLineGroup
 
 */
 
byte GetSnowLine()
 
{
 
	if (_snow_line == NULL) return _settings_game.game_creation.snow_line;
 
	if (_snow_line == NULL) return _settings_game.game_creation.snow_line_height * TILE_HEIGHT;
 

	
 
	YearMonthDay ymd;
 
	ConvertDateToYMD(_date, &ymd);
 
	return _snow_line->table[ymd.month][ymd.day];
 
}
 

	
 
@@ -572,23 +572,23 @@ byte GetSnowLine()
 
 * Get the highest possible snow line height, either variable or static.
 
 * @return the highest snow line height.
 
 * @ingroup SnowLineGroup
 
 */
 
byte HighestSnowLine()
 
{
 
	return _snow_line == NULL ? _settings_game.game_creation.snow_line : _snow_line->highest_value;
 
	return _snow_line == NULL ? _settings_game.game_creation.snow_line_height * TILE_HEIGHT : _snow_line->highest_value;
 
}
 

	
 
/**
 
 * Get the lowest possible snow line height, either variable or static.
 
 * @return the lowest snow line height.
 
 * @ingroup SnowLineGroup
 
 */
 
byte LowestSnowLine()
 
{
 
	return _snow_line == NULL ? _settings_game.game_creation.snow_line : _snow_line->lowest_value;
 
	return _snow_line == NULL ? _settings_game.game_creation.snow_line_height * TILE_HEIGHT : _snow_line->lowest_value;
 
}
 

	
 
/**
 
 * Clear the variable snow line table and free the memory.
 
 * @ingroup SnowLineGroup
 
 */
src/misc.cpp
Show inline comments
 
@@ -32,13 +32,12 @@
 
extern TileIndex _cur_tileloop_tile;
 
extern void MakeNewgameSettingsLive();
 

	
 
void InitializeSound();
 
void InitializeMusic();
 
void InitializeVehicles();
 
void InitializeClearLand();
 
void InitializeRailGui();
 
void InitializeRoadGui();
 
void InitializeAirportGui();
 
void InitializeDockGui();
 
void InitializeObjectGui();
 
void InitializeIndustries();
 
@@ -77,13 +76,12 @@ void InitializeGame(uint size_x, uint si
 
	InitializeMusic();
 

	
 
	InitializeVehicles();
 

	
 
	InitNewsItemStructs();
 
	InitializeLandscape();
 
	InitializeClearLand();
 
	InitializeRailGui();
 
	InitializeRoadGui();
 
	InitializeAirportGui();
 
	InitializeDockGui();
 
	InitializeObjectGui();
 
	InitializeAIGui();
src/saveload/afterload.cpp
Show inline comments
 
@@ -2645,12 +2645,17 @@ bool AfterLoadGame()
 

	
 
				}
 
			}
 
		}
 
	}
 

	
 
	/* This triggers only when old snow_lines were copied into the snow_line_height. */
 
	if (IsSavegameVersionBefore(164) && _settings_game.game_creation.snow_line_height >= MIN_SNOWLINE_HEIGHT * TILE_HEIGHT) {
 
		_settings_game.game_creation.snow_line_height /= TILE_HEIGHT;
 
	}
 

	
 
	/* When any NewGRF has been changed the availability of some vehicles might
 
	 * have been changed too. e->company_avail must be set to 0 in that case
 
	 * which is done by StartupEngines(). */
 
	if (gcf_res != GLC_ALL_GOOD) StartupEngines();
 

	
 
	/* Road stops is 'only' updating some caches */
src/saveload/oldloader_sl.cpp
Show inline comments
 
@@ -1721,13 +1721,13 @@ static const OldChunks main_chunk[] = {
 
	OCL_VAR (  OC_UINT8,    1, &_settings_game.difficulty.diff_level ),
 

	
 
	OCL_VAR ( OC_TTD | OC_UINT8,    1, &_settings_game.game_creation.landscape ),
 
	OCL_VAR ( OC_TTD | OC_UINT8,    1, &_trees_tick_ctr ),
 

	
 
	OCL_CNULL( OC_TTD, 1 ),               ///< Custom vehicle types yes/no, no longer used
 
	OCL_VAR ( OC_TTD | OC_UINT8,    1, &_settings_game.game_creation.snow_line ),
 
	OCL_VAR ( OC_TTD | OC_UINT8,    1, &_settings_game.game_creation.snow_line_height ),
 

	
 
	OCL_CNULL( OC_TTD, 32 ),              ///< new_industry_randtable, no longer used (because of new design)
 
	OCL_CNULL( OC_TTD, 36 ),              ///< cargo-stuff
 

	
 
	OCL_ASSERT( OC_TTD, 0x77179 ),
 
	OCL_ASSERT( OC_TTO, 0x4971D ),
src/settings_type.h
Show inline comments
 
@@ -213,13 +213,12 @@ struct GameCreationSettings {
 
	byte   tgen_smoothness;                  ///< how rough is the terrain from 0-3
 
	byte   tree_placer;                      ///< the tree placer algorithm
 
	byte   heightmap_rotation;               ///< rotation director for the heightmap
 
	byte   se_flat_world_height;             ///< land height a flat world gets in SE
 
	byte   town_name;                        ///< the town name generator used for town names
 
	byte   landscape;                        ///< the landscape we're currently in
 
	byte   snow_line;                        ///< the snowline level in this game
 
	byte   water_borders;                    ///< bitset of the borders that are water
 
	uint16 custom_town_number;               ///< manually entered number of towns
 
	byte   variety;                          ///< variety level applied to TGP
 
	byte   custom_sea_level;                 ///< manually entered percentage of water in the map
 
	byte   min_river_length;                 ///< the minimum river length
 
	byte   river_route_random;               ///< the amount of randomicity for the route finding
src/table/gameopt_settings.ini
Show inline comments
 
@@ -129,13 +129,13 @@ def      = 0
 
max      = 3
 
full     = _climates
 
load     = ConvertLandscape
 

	
 
[SDT_VAR]
 
base     = GameSettings
 
var      = game_creation.snow_line
 
var      = game_creation.snow_line_height
 
type     = SLE_UINT8
 
def      = DEF_SNOWLINE_HEIGHT * TILE_HEIGHT
 
min      = MIN_SNOWLINE_HEIGHT * TILE_HEIGHT
 
max      = MAX_SNOWLINE_HEIGHT * TILE_HEIGHT
 

	
 
[SDT_NULL]
src/table/settings.ini
Show inline comments
 
@@ -327,21 +327,17 @@ from     = 97
 
guiflags = SGF_NO_NETWORK
 
def      = 0
 
max      = 3
 
full     = _climates
 
load     = ConvertLandscape
 

	
 
[SDT_VAR]
 
base     = GameSettings
 
var      = game_creation.snow_line
 
type     = SLE_UINT8
 
; Snow line (or snow_line_height * TILE_HEIGHT)
 
[SDT_NULL]
 
length   = SLE_UINT8
 
from     = 97
 
guiflags = SGF_NO_NETWORK
 
def      = DEF_SNOWLINE_HEIGHT * TILE_HEIGHT
 
min      = MIN_SNOWLINE_HEIGHT * TILE_HEIGHT
 
max      = MAX_SNOWLINE_HEIGHT * TILE_HEIGHT
 
to       = 163
 

	
 
[SDT_OMANY]
 
base     = GameSettings
 
var      = vehicle.road_side
 
type     = SLE_UINT8
 
from     = 97
0 comments (0 inline, 0 general)