diff options
author | darkvater <darkvater@openttd.org> | 2005-01-10 14:43:00 +0000 |
---|---|---|
committer | darkvater <darkvater@openttd.org> | 2005-01-10 14:43:00 +0000 |
commit | 29b4ab04c319f6b88e724ff79d73ca49f5676eaa (patch) | |
tree | e114f254bcb59432fd9b8e483ca4ef7c4ef8ec89 /economy.c | |
parent | fae367ab31433c0987a2e042fb7cea40952d5ff0 (diff) | |
download | openttd-29b4ab04c319f6b88e724ff79d73ca49f5676eaa.tar.xz |
(svn r1465) -Fix: [1099101] starting year patch goes out of range. Clamped year between 1920-2090 as wel as adding defines for it.
Diffstat (limited to 'economy.c')
-rw-r--r-- | economy.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -26,8 +26,8 @@ uint GetMaskOfAllowedCurrencies(void) for (i = 0; i != lengthof(_currency_specs); i++) { uint16 to_euro = _currency_specs[i].to_euro; if (i == 23) mask |= (1 << 23); // always allow custom currency - if (to_euro != CF_NOEURO && to_euro != CF_ISEURO && _cur_year >= (to_euro-1920)) continue; - if (_cur_year < (2000-1920) && (to_euro == CF_ISEURO)) continue; + if (to_euro != CF_NOEURO && to_euro != CF_ISEURO && _cur_year >= (to_euro-MAX_YEAR_BEGIN_REAL)) continue; + if (_cur_year < (2000-MAX_YEAR_BEGIN_REAL) && (to_euro == CF_ISEURO)) continue; mask |= (1 << i); } return mask; @@ -37,7 +37,7 @@ void CheckSwitchToEuro(void) { if (_currency_specs[_opt.currency].to_euro != CF_NOEURO && _currency_specs[_opt.currency].to_euro != CF_ISEURO && - _cur_year >= (_currency_specs[_opt.currency].to_euro-1920)) { + _cur_year >= (_currency_specs[_opt.currency].to_euro-MAX_YEAR_BEGIN_REAL)) { _opt.currency = 2; // this is the index of euro above. AddNewsItem(STR_EURO_INTRODUCE, NEWS_FLAGS(NM_NORMAL,0,NT_ECONOMY,0), 0, 0); } |