@@ -490,7 +490,7 @@ Player *DoStartupNewPlayer(bool is_ai)
p->share_owners[0] = p->share_owners[1] = p->share_owners[2] = p->share_owners[3] = OWNER_SPECTATOR;

p->avail_railtypes = GetPlayerRailtypes(p->index);
p->inaugurated_year = _cur_year;
p->inaugurated_year = _cur_year - BASE_YEAR;
p->face = Random();

/* Engine renewal settings */
@@ -184,7 +184,7 @@ int32 CmdBuildRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
v->service_interval = _patches.servint_roadveh;

v->date_of_last_service = _date;
v->build_year = _cur_year;
v->build_year = _cur_year - BASE_YEAR;

v->type = VEH_Road;
v->cur_image = 0xC15;
@@ -54,7 +54,7 @@ void DrawRoadVehPurchaseInfo(int x, int y, EngineID engine_number)
y += 10;

/* Design date - Life length */
SetDParam(0, BASE_YEAR + ymd.year);
SetDParam(0, ymd.year);
SetDParam(1, e->lifelength);
DrawString(x, y, STR_PURCHASE_INFO_DESIGNED_LIFE, 0);
y += 10;
@@ -1206,7 +1206,7 @@ static const SettingDescGlobVarList _network_settings[] = {
SDTG_BOOL("autoclean_companies", S, 0, _network_autoclean_companies, false, STR_NULL, NULL),
SDTG_VAR("autoclean_unprotected",SLE_UINT8, S, 0, _network_autoclean_unprotected,12, 0, 60, STR_NULL, NULL),
SDTG_VAR("autoclean_protected", SLE_UINT8, S, 0, _network_autoclean_protected, 36, 0, 180, STR_NULL, NULL),
SDTG_VAR("restart_game_year", SLE_UINT16, S,D0, _network_restart_game_year, 0, MIN_YEAR, MAX_YEAR, STR_NULL, NULL),
SDTG_VAR("restart_game_year", SLE_INT16, S,D0, _network_restart_game_year, 0, MIN_YEAR, MAX_YEAR, STR_NULL, NULL),
SDTG_END()
};
#endif /* ENABLE_NETWORK */
@@ -1320,9 +1320,9 @@ const SettingDesc _patch_settings[] = {
SDT_BOOL(Patches, same_industry_close, 0, 0, false, STR_CONFIG_PATCHES_SAMEINDCLOSE, NULL),
SDT_BOOL(Patches, bribe, 0, 0, true, STR_CONFIG_PATCHES_BRIBE, NULL),
SDT_VAR(Patches, snow_line_height,SLE_UINT8, 0, 0, 7, 2, 13, STR_CONFIG_PATCHES_SNOWLINE_HEIGHT, NULL),
SDT_VAR(Patches, colored_news_year,SLE_UINT, 0,NC, 2000, MIN_YEAR, MAX_YEAR, STR_CONFIG_PATCHES_COLORED_NEWS_YEAR,NULL),
SDT_VAR(Patches, starting_year, SLE_UINT, 0,NC, 1950, MIN_YEAR, MAX_YEAR, STR_CONFIG_PATCHES_STARTING_YEAR,NULL),
SDT_VAR(Patches, ending_year, SLE_UINT,0,NC|NO,2051, MIN_YEAR, MAX_YEAR, STR_CONFIG_PATCHES_ENDING_YEAR, NULL),
SDT_VAR(Patches, colored_news_year,SLE_FILE_U32 | SLE_VAR_I16, 0,NC, 2000, MIN_YEAR, MAX_YEAR, STR_CONFIG_PATCHES_COLORED_NEWS_YEAR,NULL),
SDT_VAR(Patches, starting_year, SLE_FILE_U32 | SLE_VAR_I16, 0,NC, 1950, MIN_YEAR, MAX_YEAR, STR_CONFIG_PATCHES_STARTING_YEAR,NULL),
SDT_VAR(Patches, ending_year, SLE_FILE_U32 | SLE_VAR_I16,0,NC|NO,2051, MIN_YEAR, MAX_YEAR, STR_CONFIG_PATCHES_ENDING_YEAR, NULL),
SDT_BOOL(Patches, smooth_economy, 0, 0, true, STR_CONFIG_PATCHES_SMOOTH_ECONOMY, NULL),
SDT_BOOL(Patches, allow_shares, 0, 0, true, STR_CONFIG_PATCHES_ALLOW_SHARES, NULL),

@@ -901,7 +901,7 @@ int32 CmdBuildShip(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)

v->service_interval = _patches.servint_ships;
v->date_of_last_service = _date;
v->build_year = _cur_year;
v->build_year = _cur_year - BASE_YEAR;
v->cur_image = 0x0E5E;
v->type = VEH_Ship;
v->random_bits = VehicleRandomBits();
@@ -54,7 +54,7 @@ void DrawShipPurchaseInfo(int x, int y, EngineID engine_number)
/* Design date - Life length */
e = GetEngine(engine_number);
ConvertDateToYMD(e->intro_date, &ymd);
SetDParam(0, BASE_YEAR + ymd.year);
SetDParam(0, ymd.year);
SetDParam(1, e->lifelength);
DrawString(x,y, STR_PURCHASE_INFO_DESIGNED_LIFE, 0);
y += 10;
@@ -339,7 +339,7 @@ static char *FormatYmdString(char *buff, Date date)
for (src = GetStringPtr(STR_0162_JAN + ymd.month); (*buff++ = *src++) != '\0';) {}
buff[-1] = ' ';

return FormatNoCommaNumber(buff, BASE_YEAR + ymd.year);
return FormatNoCommaNumber(buff, ymd.year);
}

static char *FormatMonthAndYear(char *buff, Date date)
@@ -352,15 +352,15 @@ static char *FormatMonthAndYear(char *buff, Date date)
for (src = GetStringPtr(STR_MONTH_JAN + ymd.month); (*buff++ = *src++) != '\0';) {}
buff[-1] = ' ';

return FormatNoCommaNumber(buff, BASE_YEAR + ymd.year);
return FormatNoCommaNumber(buff, ymd.year);
}

static char *FormatTinyDate(char *buff, Date date)
{
YearMonthDay ymd;

ConvertDateToYMD(date, &ymd);
buff += sprintf(buff, " %02i-%02i-%04i", ymd.day, ymd.month + 1, BASE_YEAR + ymd.year);
buff += sprintf(buff, " %02i-%02i-%04i", ymd.day, ymd.month + 1, ymd.year);

return buff;
}
@@ -2019,120 +2019,120 @@ assert_compile(lengthof(_housetype_remove_ratingmod) == HOUSE_MAX);


typedef struct {
byte min,max;
Year min, max;
} HousetypeYear;

static const HousetypeYear _housetype_years[] = {
{43, 255},
{37, 255},
{48, 255},
{0, 255},
{55, 255},
{55, 255},
{0, 255},
{39, 255},
{39, 255},
{25, 255},
{25, 255},
{0, 255},
{15, 255},
{31, 255},
{10, 40},
{10, 40},
{10, 40},
{57, 255},
{63, 255},
{65, 255},
{0, 255},
{0, 255},
{0, 255},
{0, 255},
{0, 31},
{0, 32},
{11, 255},
{15, 255},
{43, 255},
{0, 35},
{53, 255},
{0, 255},
{38, 255},
{38, 255},
{38, 255},
{38, 255},
{80, 255},
{0, 40},
{0, 40},
{25, 255},
{63, 255},
{63, 255},
{63, 255},
{63, 255},
{0, 255},
{0, 255},
{0, 255},
{0, 255},
{0, 43},
{0, 43},
{46, 255},
{46, 255},
{50, 255},
{50, 255},
{54, 255},
{54, 255},
{0, 255},
{0, 255},
{0, 255},
{0, 255},
{0, 255},
{0, 255},
{0, 255},
{0, 255},
{0, 40},
{0, 40},
{52, 255},
{52, 255},
{52, 255},
{52, 255},
{43, 255},
{43, 255},
{58, 255},
{58, 255},
{47, 255},
{47, 255},
{47, 255},
{47, 255},
{0, 255},
{0, 255},
{0, 255},
{0, 255},
{0, 255},
{0, 255},
{0, 255},
{53, 255},
{42, 255},
{64, 255},
{64, 255},
{0, 255},
{73, 255},
{0, 255},
{0, 255},
{0, 255},
{0, 255},
{0, 255},
{0, 255},
{0, 255},
{0, 255},
{0, 255},
{0, 255},
{0, 255},
{0, 255},
{0, 255},
{0, 255},
{0, 255},
{0, 255},
{0, 255},
{0, 255},
{0, 255},
{ 1963, MAX_YEAR },
{ 1957, MAX_YEAR },
{ 1968, MAX_YEAR },
{ 0, MAX_YEAR },
{ 1975, MAX_YEAR },
{ 1975, MAX_YEAR },
{ 0, MAX_YEAR },
{ 1959, MAX_YEAR },
{ 1959, MAX_YEAR },
{ 1945, MAX_YEAR },
{ 1945, MAX_YEAR },
{ 0, MAX_YEAR },
{ 1935, MAX_YEAR },
{ 1951, MAX_YEAR },
{ 1930, 1960 },
{ 1930, 1960 },
{ 1930, 1960 },
{ 1977, MAX_YEAR },
{ 1983, MAX_YEAR },
{ 1985, MAX_YEAR },
{ 0, MAX_YEAR },
{ 0, MAX_YEAR },
{ 0, MAX_YEAR },
{ 0, MAX_YEAR },
{ 0, 1951 },
{ 0, 1952 },
{ 1941, MAX_YEAR },
{ 1945, MAX_YEAR },
{ 1963, MAX_YEAR },
{ 0, 1955 },
{ 1973, MAX_YEAR },
{ 0, MAX_YEAR },
{ 1958, MAX_YEAR },
{ 1958, MAX_YEAR },
{ 1958, MAX_YEAR },
{ 1958, MAX_YEAR },
{ 1950, MAX_YEAR },
{ 0, 1960 },
{ 0, 1960 },
{ 1945, MAX_YEAR },
{ 1983, MAX_YEAR },
{ 1983, MAX_YEAR },
{ 1983, MAX_YEAR },
{ 1983, MAX_YEAR },
{ 0, MAX_YEAR },
{ 0, MAX_YEAR },
{ 0, MAX_YEAR },
{ 0, MAX_YEAR },
{ 0, 1963 },
{ 0, 1963 },
{ 1966, MAX_YEAR },
{ 1966, MAX_YEAR },
{ 1970, MAX_YEAR },
{ 1970, MAX_YEAR },
{ 1974, MAX_YEAR },
{ 1974, MAX_YEAR },
{ 0, MAX_YEAR },
{ 0, MAX_YEAR },
{ 0, MAX_YEAR },
{ 0, MAX_YEAR },
{ 0, MAX_YEAR },
{ 0, MAX_YEAR },
{ 0, MAX_YEAR },
{ 0, MAX_YEAR },
{ 0, 1960 },
{ 0, 1960 },
{ 1972, MAX_YEAR },
{ 1972, MAX_YEAR },
{ 1972, MAX_YEAR },
{ 1972, MAX_YEAR },
{ 1963, MAX_YEAR },
{ 1963, MAX_YEAR },
{ 1978, MAX_YEAR },
{ 1978, MAX_YEAR },
{ 1967, MAX_YEAR },
{ 1967, MAX_YEAR },
{ 1967, MAX_YEAR },
{ 1967, MAX_YEAR },
{ 0, MAX_YEAR },
{ 0, MAX_YEAR },
{ 0, MAX_YEAR },
{ 0, MAX_YEAR },
{ 0, MAX_YEAR },
{ 0, MAX_YEAR },
{ 0, MAX_YEAR },
{ 1973, MAX_YEAR },
{ 1962, MAX_YEAR },
{ 1984, MAX_YEAR },
{ 1984, MAX_YEAR },
{ 0, MAX_YEAR },
{ 1993, MAX_YEAR },
{ 0, MAX_YEAR },
{ 0, MAX_YEAR },
{ 0, MAX_YEAR },
{ 0, MAX_YEAR },
{ 0, MAX_YEAR },
{ 0, MAX_YEAR },
{ 0, MAX_YEAR },
{ 0, MAX_YEAR },
{ 0, MAX_YEAR },
{ 0, MAX_YEAR },
{ 0, MAX_YEAR },
{ 0, MAX_YEAR },
{ 0, MAX_YEAR },
{ 0, MAX_YEAR },
{ 0, MAX_YEAR },
{ 0, MAX_YEAR },
{ 0, MAX_YEAR },
{ 0, MAX_YEAR },
{ 0, MAX_YEAR },
};
assert_compile(lengthof(_housetype_years) == HOUSE_MAX);

@@ -623,7 +623,7 @@ static int32 CmdBuildRailWagon(EngineID engine, TileIndex tile, uint32 flags)

v->u.rail.railtype = GetEngine(engine)->railtype;

v->build_year = _cur_year;
v->build_year = _cur_year - BASE_YEAR;
v->type = VEH_Train;
v->cur_image = 0xAC2;
v->random_bits = VehicleRandomBits();
@@ -783,7 +783,7 @@ int32 CmdBuildRailVehicle(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)

v->service_interval = _patches.servint_trains;
v->date_of_last_service = _date;
v->build_year = _cur_year;
v->build_year = _cur_year - BASE_YEAR;
v->type = VEH_Train;
v->cur_image = 0xAC2;
v->random_bits = VehicleRandomBits();
@@ -73,7 +73,7 @@ void DrawTrainEnginePurchaseInfo(int x, int y, EngineID engine_number)
y += 10;

/* Design date - Life length */
SetDParam(0, BASE_YEAR + ymd.year);
SetDParam(0, ymd.year);
SetDParam(1, e->lifelength);
DrawString(x,y, STR_PURCHASE_INFO_DESIGNED_LIFE, 0);
y += 10;
@@ -38,26 +38,26 @@ extern void DrawCanalWater(TileIndex tile);

const Bridge orig_bridge[] = {
/*
year of availablity
| minimum length
| | maximum length
| | | price
| | | | maximum speed
| | | | | sprite to use in GUI string with description
| | | | | | | */
{ 0, 0, 16, 80, 32, 0xA24 , STR_5012_WOODEN , NULL, 0 },
{ 0, 0, 2, 112, 48, 0xA26 | PALETTE_TO_STRUCT_RED , STR_5013_CONCRETE , NULL, 0 },
{ 10, 0, 5, 144, 64, 0xA25 , STR_500F_GIRDER_STEEL , NULL, 0 },
{ 0, 2, 10, 168, 80, 0xA22 | PALETTE_TO_STRUCT_CONCRETE, STR_5011_SUSPENSION_CONCRETE, NULL, 0 },
{ 10, 3, 16, 185, 96, 0xA22 , STR_500E_SUSPENSION_STEEL , NULL, 0 },
{ 10, 3, 16, 192, 112, 0xA22 | PALETTE_TO_STRUCT_YELLOW , STR_500E_SUSPENSION_STEEL , NULL, 0 },
{ 10, 3, 7, 224, 160, 0xA23 , STR_5010_CANTILEVER_STEEL , NULL, 0 },
{ 10, 3, 8, 232, 208, 0xA23 | PALETTE_TO_STRUCT_BROWN , STR_5010_CANTILEVER_STEEL , NULL, 0 },
{ 10, 3, 9, 248, 240, 0xA23 | PALETTE_TO_STRUCT_RED , STR_5010_CANTILEVER_STEEL , NULL, 0 },
{ 10, 0, 2, 240, 256, 0xA27 , STR_500F_GIRDER_STEEL , NULL, 0 },
{ 75, 2, 16, 255, 320, 0xA28 , STR_5014_TUBULAR_STEEL , NULL, 0 },
{ 85, 2, 32, 380, 512, 0xA28 | PALETTE_TO_STRUCT_YELLOW , STR_5014_TUBULAR_STEEL , NULL, 0 },
{ 90, 2, 32, 510, 608, 0xA28 | PALETTE_TO_STRUCT_GREY , STR_BRIDGE_TUBULAR_SILICON , NULL, 0 }
year of availablity
| minimum length
| | maximum length
| | | price
| | | | maximum speed
| | | | | sprite to use in GUI string with description
| | | | | | | */
{ 0, 0, 16, 80, 32, 0xA24 , STR_5012_WOODEN , NULL, 0 },
{ 0, 0, 2, 112, 48, 0xA26 | PALETTE_TO_STRUCT_RED , STR_5013_CONCRETE , NULL, 0 },
{ 1930, 0, 5, 144, 64, 0xA25 , STR_500F_GIRDER_STEEL , NULL, 0 },
{ 0, 2, 10, 168, 80, 0xA22 | PALETTE_TO_STRUCT_CONCRETE, STR_5011_SUSPENSION_CONCRETE, NULL, 0 },
{ 1930, 3, 16, 185, 96, 0xA22 , STR_500E_SUSPENSION_STEEL , NULL, 0 },
{ 1930, 3, 16, 192, 112, 0xA22 | PALETTE_TO_STRUCT_YELLOW , STR_500E_SUSPENSION_STEEL , NULL, 0 },
{ 1930, 3, 7, 224, 160, 0xA23 , STR_5010_CANTILEVER_STEEL , NULL, 0 },
{ 1930, 3, 8, 232, 208, 0xA23 | PALETTE_TO_STRUCT_BROWN , STR_5010_CANTILEVER_STEEL , NULL, 0 },
{ 1930, 3, 9, 248, 240, 0xA23 | PALETTE_TO_STRUCT_RED , STR_5010_CANTILEVER_STEEL , NULL, 0 },
{ 1930, 0, 2, 240, 256, 0xA27 , STR_500F_GIRDER_STEEL , NULL, 0 },
{ 1995, 2, 16, 255, 320, 0xA28 , STR_5014_TUBULAR_STEEL , NULL, 0 },
{ 2005, 2, 32, 380, 512, 0xA28 | PALETTE_TO_STRUCT_YELLOW , STR_5014_TUBULAR_STEEL , NULL, 0 },
{ 2010, 2, 32, 510, 608, 0xA28 | PALETTE_TO_STRUCT_GREY , STR_BRIDGE_TUBULAR_SILICON , NULL, 0 }
};

Bridge _bridge[MAX_BRIDGES];
@@ -147,9 +147,9 @@ typedef struct Patches {
bool ai_disable_veh_roadveh; // disable types for AI
bool ai_disable_veh_aircraft; // disable types for AI
bool ai_disable_veh_ship; // disable types for AI
uint32 starting_year; // starting date
uint32 ending_year; // end of the game (just show highscore)
uint32 colored_news_year; // when does newspaper become colored?
Year starting_year; // starting date
Year ending_year; // end of the game (just show highscore)
Year colored_news_year; // when does newspaper become colored?

bool keep_all_autosave; // name the autosave in a different way.
bool autosave_on_exit; // save an autosave when you quit the game, but do not ask "Do you really want to quit?"