summaryrefslogtreecommitdiff
path: root/economy.c
diff options
context:
space:
mode:
authordominik <dominik@openttd.org>2004-12-22 16:54:55 +0000
committerdominik <dominik@openttd.org>2004-12-22 16:54:55 +0000
commit13eba00152fda7a1458b7820e0787b001c4e772a (patch)
tree185e746f2a0c7915cb636b6cc2d0c25d916eab2c /economy.c
parenta5a49135bc688b76afa64e92fb903dbf9ad6b2e1 (diff)
downloadopenttd-13eba00152fda7a1458b7820e0787b001c4e772a.tar.xz
(svn r1222) Currency cleanup. Changed some currency symbols according to forum suggestions (thx ChrisCF) and rearranged the currencies alphabetically (except for the major ones).
Diffstat (limited to 'economy.c')
-rw-r--r--economy.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/economy.c b/economy.c
index 2367fe69d..d48f9a65b 100644
--- a/economy.c
+++ b/economy.c
@@ -18,6 +18,31 @@
#include "engine.h"
#include "network_data.h"
+// get a mask of the allowed currencies depending on the year
+uint GetMaskOfAllowedCurrencies()
+{
+ int i;
+ uint mask = 0;
+ 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;
+ mask |= (1 << i);
+ }
+ return mask;
+}
+
+void CheckSwitchToEuro()
+{
+ 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)) {
+ _opt.currency = 2; // this is the index of euro above.
+ AddNewsItem(STR_EURO_INTRODUCE, NEWS_FLAGS(NM_NORMAL,0,NT_ECONOMY,0), 0, 0);
+ }
+}
+
void UpdatePlayerHouse(Player *p, uint score)
{
byte val;