diff options
author | rubidium <rubidium@openttd.org> | 2006-08-15 15:18:03 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2006-08-15 15:18:03 +0000 |
commit | 0d3ccad29fb035fced3a1a87b7804fde8c4e94b1 (patch) | |
tree | 40cc27f619e175b8c9a80e13e6651c33b92144aa /date.c | |
parent | 8aa76f306db00b81f14b53a736b6e30099258841 (diff) | |
download | openttd-0d3ccad29fb035fced3a1a87b7804fde8c4e94b1.tar.xz |
(svn r5916) -Cleanup: use MIN_YEAR/MAX_YEAR for the year boundaries and BASE_YEAR when comparing _cur_year with a 'full' year.
-Cleanup: replace some magic '1920' values with BASE_YEAR.
Diffstat (limited to 'date.c')
-rw-r--r-- | date.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -129,7 +129,7 @@ Date ConvertIntDate(uint date) Month month = 0; Day day = 1; - if (IS_INT_INSIDE(date, 1920, MAX_YEAR_END_REAL + 1)) { + if (IS_INT_INSIDE(date, 1920, MAX_YEAR + 1)) { year = date - 1920; } else if (IS_INT_INSIDE(date, 192001, 209012 + 1)) { month = date % 100 - 1; @@ -282,13 +282,13 @@ void IncreaseDate(void) #endif /* ENABLE_NETWORK */ /* check if we reached end of the game */ - if (_cur_year == _patches.ending_year - MAX_YEAR_BEGIN_REAL) { + if (_cur_year == _patches.ending_year - MAX_YEAR) { ShowEndGameChart(); /* check if we reached the maximum year, decrement dates by a year */ - } else if (_cur_year == (MAX_YEAR_END + 1)) { + } else if (BASE_YEAR + _cur_year == MAX_YEAR + 1) { Vehicle *v; - _cur_year = MAX_YEAR_END; + _cur_year--; _date -= 365; FOR_ALL_VEHICLES(v) { v->date_of_last_service -= 365; |