# HG changeset patch # User rubidium # Date 1156100728 0 # Node ID 0e6e689f66e7a962db8376cd4759d303b4a6d7a6 # Parent 1b3940c35724764fcb3c614515b973c206389357 (svn r6002) -Cleanup: remove the now redundant BASE_YEAR constant. diff -r 1b3940c35724 -r 0e6e689f66e7 aircraft_cmd.c --- a/aircraft_cmd.c Sun Aug 20 18:44:26 2006 +0000 +++ b/aircraft_cmd.c Sun Aug 20 19:05:28 2006 +0000 @@ -362,7 +362,7 @@ v->service_interval = _patches.servint_aircraft; v->date_of_last_service = _date; - v->build_year = u->build_year = _cur_year - BASE_YEAR; + v->build_year = u->build_year = _cur_year; v->cur_image = u->cur_image = 0xEA0; diff -r 1b3940c35724 -r 0e6e689f66e7 aircraft_gui.c --- a/aircraft_gui.c Sun Aug 20 18:44:26 2006 +0000 +++ b/aircraft_gui.c Sun Aug 20 19:05:28 2006 +0000 @@ -402,7 +402,7 @@ do { if (v->subtype <= 2) { SetDParam(0, GetCustomEngineName(v->engine_type)); - SetDParam(1, BASE_YEAR + v->build_year); + SetDParam(1, v->build_year); SetDParam(2, v->value); DrawString(60, y, STR_A011_BUILT_VALUE, 0); y += 10; diff -r 1b3940c35724 -r 0e6e689f66e7 console_cmds.c --- a/console_cmds.c Sun Aug 20 18:44:26 2006 +0000 +++ b/console_cmds.c Sun Aug 20 19:05:28 2006 +0000 @@ -1202,7 +1202,7 @@ GetString(buffer, STR_00D1_DARK_BLUE + _player_colors[p->index]); IConsolePrintF(8, "#:%d(%s) Company Name: '%s' Year Founded: %d Money: %d Loan: %d Value: %" OTTD_PRINTF64 "d (T:%d, R:%d, P:%d, S:%d)", - p->index + 1, buffer, _network_player_info[p->index].company_name, BASE_YEAR + p->inaugurated_year, p->player_money, p->current_loan, CalculateCompanyValue(p), + p->index + 1, buffer, _network_player_info[p->index].company_name, p->inaugurated_year, p->player_money, p->current_loan, CalculateCompanyValue(p), /* trains */ _network_player_info[p->index].num_vehicle[0], /* lorry + bus */ _network_player_info[p->index].num_vehicle[1] + _network_player_info[p->index].num_vehicle[2], /* planes */ _network_player_info[p->index].num_vehicle[3], diff -r 1b3940c35724 -r 0e6e689f66e7 date.h --- a/date.h Sun Aug 20 18:44:26 2006 +0000 +++ b/date.h Sun Aug 20 19:05:28 2006 +0000 @@ -26,9 +26,6 @@ */ #define DAYS_TILL_ORIGINAL_BASE_YEAR (365 * ORIGINAL_BASE_YEAR + ORIGINAL_BASE_YEAR / 4 - ORIGINAL_BASE_YEAR / 100 + ORIGINAL_BASE_YEAR / 400) -/* Temporary value to make transition to full past 2090 easier/more clear */ -#define BASE_YEAR 0 - /* The absolute minimum & maximum years in OTTD */ #define MIN_YEAR 0 /* MAX_YEAR, nicely rounded value of the number of years that can diff -r 1b3940c35724 -r 0e6e689f66e7 economy.c --- a/economy.c Sun Aug 20 18:44:26 2006 +0000 +++ b/economy.c Sun Aug 20 19:05:28 2006 +0000 @@ -1394,7 +1394,7 @@ // if last speed is 0, we treat that as if no vehicle has ever visited the station. ge->last_speed = min(t, 255); - ge->last_age = (_cur_year - BASE_YEAR) - v->build_year; + ge->last_age = _cur_year - v->build_year; // If there's goods waiting at the station, and the vehicle // has capacity for it, load it on the vehicle. @@ -1546,7 +1546,7 @@ p = GetPlayer(p1); /* Protect new companies from hostile takeovers */ - if ((_cur_year - BASE_YEAR) - p->inaugurated_year < 6) return_cmd_error(STR_7080_PROTECTED); + if (_cur_year - p->inaugurated_year < 6) return_cmd_error(STR_7080_PROTECTED); /* Those lines are here for network-protection (clients can be slow) */ if (GetAmountOwnedBy(p, OWNER_SPECTATOR) == 0) return 0; diff -r 1b3940c35724 -r 0e6e689f66e7 industry_cmd.c --- a/industry_cmd.c Sun Aug 20 18:44:26 2006 +0000 +++ b/industry_cmd.c Sun Aug 20 19:05:28 2006 +0000 @@ -1459,7 +1459,7 @@ i->total_transported[0] = 0; i->total_transported[1] = 0; i->was_cargo_delivered = false; - i->last_prod_year = _cur_year - BASE_YEAR; + i->last_prod_year = _cur_year; i->total_production[0] = i->production_rate[0] * 8; i->total_production[1] = i->production_rate[1] * 8; @@ -1661,7 +1661,7 @@ return; case INDUSTRYLIFE_CLOSABLE: - if ((byte)((_cur_year - BASE_YEAR) - i->last_prod_year) < 5 || !CHANCE16(1, 180)) + if ((byte)(_cur_year - i->last_prod_year) < 5 || !CHANCE16(1, 180)) closeit = false; break; @@ -1724,7 +1724,7 @@ if (i->produced_cargo[0] != CT_INVALID) { pct = 0; if (i->last_mo_production[0] != 0) { - i->last_prod_year = _cur_year - BASE_YEAR; + i->last_prod_year = _cur_year; pct = min(i->last_mo_transported[0] * 256 / i->last_mo_production[0],255); } i->pct_transported[0] = pct; @@ -1739,7 +1739,7 @@ if (i->produced_cargo[1] != CT_INVALID) { pct = 0; if (i->last_mo_production[1] != 0) { - i->last_prod_year = _cur_year - BASE_YEAR; + i->last_prod_year = _cur_year; pct = min(i->last_mo_transported[1] * 256 / i->last_mo_production[1],255); } i->pct_transported[1] = pct; @@ -1851,7 +1851,7 @@ case INDUSTRYLIFE_CLOSABLE: /* maybe close */ - if ( (byte)((_cur_year - BASE_YEAR) - i->last_prod_year) >= 5 && CHANCE16(1,2)) { + if ( (byte)(_cur_year - i->last_prod_year) >= 5 && CHANCE16(1,2)) { i->prod_level = 0; str = indspec->closure_text; } diff -r 1b3940c35724 -r 0e6e689f66e7 network_gui.c --- a/network_gui.c Sun Aug 20 18:44:26 2006 +0000 +++ b/network_gui.c Sun Aug 20 19:05:28 2006 +0000 @@ -881,7 +881,7 @@ DrawStringTruncated(x, y, STR_NETWORK_COMPANY_NAME, 2, trunc_width); y += 10; - SetDParam(0, BASE_YEAR + _network_player_info[nd->company].inaugurated_year); + SetDParam(0, _network_player_info[nd->company].inaugurated_year); DrawString(x, y, STR_NETWORK_INAUGURATION_YEAR, 2); // inauguration year y += 10; diff -r 1b3940c35724 -r 0e6e689f66e7 network_server.c --- a/network_server.c Sun Aug 20 18:44:26 2006 +0000 +++ b/network_server.c Sun Aug 20 19:05:28 2006 +0000 @@ -1209,7 +1209,7 @@ GetString(_network_player_info[p->index].company_name, STR_JUST_STRING); // Check the income - if (_cur_year - 1 == BASE_YEAR + p->inaugurated_year) { + if (_cur_year - 1 == p->inaugurated_year) { // The player is here just 1 year, so display [2], else display[1] for (i = 0; i < 13; i++) { _network_player_info[p->index].income -= p->yearly_expenses[2][i]; diff -r 1b3940c35724 -r 0e6e689f66e7 player_gui.c --- a/player_gui.c Sun Aug 20 18:44:26 2006 +0000 +++ b/player_gui.c Sun Aug 20 19:05:28 2006 +0000 @@ -46,7 +46,7 @@ x = 215; tbl = p->yearly_expenses + 2; do { - if (year >= BASE_YEAR + p->inaugurated_year) { + if (year >= p->inaugurated_year) { SetDParam(0, year); DrawStringRightAlignedUnderline(x, 15, STR_7010, 0); sum = 0; @@ -537,7 +537,7 @@ w->disabled_state = dis; DrawWindowWidgets(w); - SetDParam(0, BASE_YEAR + p->inaugurated_year); + SetDParam(0, p->inaugurated_year); DrawString(110, 25, STR_7038_INAUGURATED, 0); DrawPlayerVehiclesAmount(w->window_number); diff -r 1b3940c35724 -r 0e6e689f66e7 roadveh_cmd.c --- a/roadveh_cmd.c Sun Aug 20 18:44:26 2006 +0000 +++ b/roadveh_cmd.c Sun Aug 20 19:05:28 2006 +0000 @@ -184,7 +184,7 @@ v->service_interval = _patches.servint_roadveh; v->date_of_last_service = _date; - v->build_year = _cur_year - BASE_YEAR; + v->build_year = _cur_year; v->type = VEH_Road; v->cur_image = 0xC15; diff -r 1b3940c35724 -r 0e6e689f66e7 roadveh_gui.c --- a/roadveh_gui.c Sun Aug 20 18:44:26 2006 +0000 +++ b/roadveh_gui.c Sun Aug 20 19:05:28 2006 +0000 @@ -216,7 +216,7 @@ DrawRoadVehImage(v, 3, 57, INVALID_VEHICLE); SetDParam(0, GetCustomEngineName(v->engine_type)); - SetDParam(1, BASE_YEAR + v->build_year); + SetDParam(1, v->build_year); SetDParam(2, v->value); DrawString(34, 57, STR_9011_BUILT_VALUE, 0); diff -r 1b3940c35724 -r 0e6e689f66e7 ship_cmd.c --- a/ship_cmd.c Sun Aug 20 18:44:26 2006 +0000 +++ b/ship_cmd.c Sun Aug 20 19:05:28 2006 +0000 @@ -901,7 +901,7 @@ v->service_interval = _patches.servint_ships; v->date_of_last_service = _date; - v->build_year = _cur_year - BASE_YEAR; + v->build_year = _cur_year; v->cur_image = 0x0E5E; v->type = VEH_Ship; v->random_bits = VehicleRandomBits(); diff -r 1b3940c35724 -r 0e6e689f66e7 ship_gui.c --- a/ship_gui.c Sun Aug 20 18:44:26 2006 +0000 +++ b/ship_gui.c Sun Aug 20 19:05:28 2006 +0000 @@ -212,7 +212,7 @@ DrawShipImage(v, 3, 57, INVALID_VEHICLE); - SetDParam(1, BASE_YEAR + v->build_year); + SetDParam(1, v->build_year); SetDParam(0, GetCustomEngineName(v->engine_type)); SetDParam(2, v->value); DrawString(74, 57, STR_9816_BUILT_VALUE, 0); diff -r 1b3940c35724 -r 0e6e689f66e7 train_cmd.c --- a/train_cmd.c Sun Aug 20 18:44:26 2006 +0000 +++ b/train_cmd.c Sun Aug 20 19:05:28 2006 +0000 @@ -623,7 +623,7 @@ v->u.rail.railtype = GetEngine(engine)->railtype; - v->build_year = _cur_year - BASE_YEAR; + v->build_year = _cur_year; v->type = VEH_Train; v->cur_image = 0xAC2; v->random_bits = VehicleRandomBits(); @@ -783,7 +783,7 @@ v->service_interval = _patches.servint_trains; v->date_of_last_service = _date; - v->build_year = _cur_year - BASE_YEAR; + v->build_year = _cur_year; v->type = VEH_Train; v->cur_image = 0xAC2; v->random_bits = VehicleRandomBits(); diff -r 1b3940c35724 -r 0e6e689f66e7 train_gui.c --- a/train_gui.c Sun Aug 20 18:44:26 2006 +0000 +++ b/train_gui.c Sun Aug 20 19:05:28 2006 +0000 @@ -1115,7 +1115,7 @@ if (!(rvi->flags & RVI_WAGON)) { SetDParam(0, GetCustomEngineName(v->engine_type)); - SetDParam(1, BASE_YEAR + v->build_year); + SetDParam(1, v->build_year); SetDParam(2, v->value); DrawString(x, y, STR_882C_BUILT_VALUE, 0x10); } else {