diff options
author | tron <tron@openttd.org> | 2005-08-07 12:41:57 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-08-07 12:41:57 +0000 |
commit | 14e80ca15968476fffdbc64c5dc5edae9145c0d8 (patch) | |
tree | 48e4b97d4e158c2a7f487423c480569db2b96b82 /currency.c | |
parent | 59da8350c137a14dfbd194128a37591634247e46 (diff) | |
download | openttd-14e80ca15968476fffdbc64c5dc5edae9145c0d8.tar.xz |
(svn r2830) Move CheckSwitchToEuro() to currency.[ch] and hide the truth about the custom currency behind a #define
Diffstat (limited to 'currency.c')
-rw-r--r-- | currency.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/currency.c b/currency.c index 29a698bd3..b6d5c14d4 100644 --- a/currency.c +++ b/currency.c @@ -3,6 +3,7 @@ #include "stdafx.h" #include "openttd.h" #include "currency.h" +#include "news.h" #include "variables.h" #include "table/strings.h" @@ -92,3 +93,14 @@ uint GetCurrentCurrencyRate(void) { return _currency_specs[_opt_ptr->currency].rate; } + + +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) { + _opt.currency = 2; // this is the index of euro above. + AddNewsItem(STR_EURO_INTRODUCE, NEWS_FLAGS(NM_NORMAL, 0, NT_ECONOMY, 0), 0, 0); + } +} |