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 /currency.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 'currency.c')
-rw-r--r-- | currency.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/currency.c b/currency.c index 8ade72211..31e461687 100644 --- a/currency.c +++ b/currency.c @@ -81,8 +81,8 @@ uint GetMaskOfAllowedCurrencies(void) for (i = 0; i != lengthof(_currency_specs); i++) { uint16 to_euro = _currency_specs[i].to_euro; - if (to_euro != CF_NOEURO && to_euro != CF_ISEURO && _cur_year >= to_euro - MAX_YEAR_BEGIN_REAL) continue; - if (to_euro == CF_ISEURO && _cur_year < 2000 - MAX_YEAR_BEGIN_REAL) continue; + if (to_euro != CF_NOEURO && to_euro != CF_ISEURO && BASE_YEAR + _cur_year >= to_euro) continue; + if (to_euro == CF_ISEURO && BASE_YEAR + _cur_year < 2000) continue; mask |= (1 << i); } mask |= (1 << CUSTOM_CURRENCY_ID); // always allow custom currency @@ -94,7 +94,7 @@ void CheckSwitchToEuro(void) { if (_currency_specs[_opt.currency].to_euro != CF_NOEURO && _currency_specs[_opt.currency].to_euro != CF_ISEURO && - MAX_YEAR_BEGIN_REAL + _cur_year >= _currency_specs[_opt.currency].to_euro) { + BASE_YEAR + _cur_year >= _currency_specs[_opt.currency].to_euro) { _opt.currency = 2; // this is the index of euro above. AddNewsItem(STR_EURO_INTRODUCE, NEWS_FLAGS(NM_NORMAL, 0, NT_ECONOMY, 0), 0, 0); } |