Mercurial > hg > openttd
changeset 4329:802bb06b06cf draft
(svn r6002) -Cleanup: remove the now redundant BASE_YEAR constant.
author | rubidium <rubidium@openttd.org> |
---|---|
date | Sun, 20 Aug 2006 19:05:28 +0000 |
parents | 09812fd65f12 |
children | 0b698c3335ab |
files | aircraft_cmd.c aircraft_gui.c console_cmds.c date.h economy.c industry_cmd.c network_gui.c network_server.c player_gui.c roadveh_cmd.c roadveh_gui.c ship_cmd.c ship_gui.c train_cmd.c train_gui.c |
diffstat | 15 files changed, 21 insertions(+), 24 deletions(-) [+] |
line wrap: on
line diff
--- a/aircraft_cmd.c +++ b/aircraft_cmd.c @@ -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;
--- a/aircraft_gui.c +++ b/aircraft_gui.c @@ -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;
--- a/console_cmds.c +++ b/console_cmds.c @@ -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],
--- a/date.h +++ b/date.h @@ -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
--- a/economy.c +++ b/economy.c @@ -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;
--- a/industry_cmd.c +++ b/industry_cmd.c @@ -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; }
--- a/network_gui.c +++ b/network_gui.c @@ -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;
--- a/network_server.c +++ b/network_server.c @@ -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];
--- a/player_gui.c +++ b/player_gui.c @@ -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);
--- a/roadveh_cmd.c +++ b/roadveh_cmd.c @@ -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;
--- a/roadveh_gui.c +++ b/roadveh_gui.c @@ -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);
--- a/ship_cmd.c +++ b/ship_cmd.c @@ -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();
--- a/ship_gui.c +++ b/ship_gui.c @@ -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);
--- a/train_cmd.c +++ b/train_cmd.c @@ -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();