(svn r2830) Move CheckSwitchToEuro() to currency.[ch] and hide the truth about the custom currency behind a #define

This commit is contained in:
tron
2005-08-07 12:41:57 +00:00
parent 59da8350c1
commit 14e80ca159
6 changed files with 42 additions and 39 deletions

View File

@@ -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);
}
}