(svn r1233) Fixed several currency issues. Now currencies should work correctly again.
authordominik
Wed, 22 Dec 2004 19:48:27 +0000
changeset 768 c833f6f2742d
parent 767 27edbcad701c
child 769 165e9f25a088
(svn r1233) Fixed several currency issues. Now currencies should work correctly again.
economy.c
lang/english.txt
table/currency.h
ttd.c
--- a/economy.c	Wed Dec 22 19:16:56 2004 +0000
+++ b/economy.c	Wed Dec 22 19:48:27 2004 +0000
@@ -19,11 +19,11 @@
 #include "network_data.h"
 
 // get a mask of the allowed currencies depending on the year
-uint GetMaskOfAllowedCurrencies()
+uint GetMaskOfAllowedCurrencies(void)
 {
 	int i;
 	uint mask = 0;
-	for(i=0; i!=lengthof(_currency_specs); i++) {
+	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;
@@ -33,7 +33,7 @@
 	return mask;
 }
 
-void CheckSwitchToEuro()
+void CheckSwitchToEuro(void)
 {
 	if (_currency_specs[_opt.currency].to_euro != CF_NOEURO &&
 			_currency_specs[_opt.currency].to_euro != CF_ISEURO &&
--- a/lang/english.txt	Wed Dec 22 19:16:56 2004 +0000
+++ b/lang/english.txt	Wed Dec 22 19:48:27 2004 +0000
@@ -2733,7 +2733,7 @@
 STR_NEWGRF_GRF_ID						:{BLACK}GRF ID:
 
 STR_CURRENCY_WINDOW								:{WHITE}Custom currency
-STR_CURRENCY_EXCHANGE_RATE				:{LTBLUE}Exchange rate: {ORANGE}{CURRENCY} = {COMMA16} {POUNDSIGN}
+STR_CURRENCY_EXCHANGE_RATE				:{LTBLUE}Exchange rate: {ORANGE}{CURRENCY} = {POUNDSIGN} {COMMA16}
 STR_CURRENCY_SEPARATOR						:{LTBLUE}Separator:
 STR_CURRENCY_PREFIX								:{LTBLUE}Prefix:
 STR_CURRENCY_POSTFIX							:{LTBLUE}Postfix:
--- a/table/currency.h	Wed Dec 22 19:16:56 2004 +0000
+++ b/table/currency.h	Wed Dec 22 19:48:27 2004 +0000
@@ -7,24 +7,26 @@
 { 2,   ',', CF_NOEURO, "$",      "" }, // us dollars
 { 2,   ',', CF_ISEURO, "¤",      "" }, // Euro
 { 200, ',', CF_NOEURO, "\xA5",   "" }, // yen
+
+{ 19,  ',', 2002,         "", " S." }, // austrian schilling
 { 57,  ',', 2002,     "BEF ",    "" }, // belgian franc
 { 2,   ',', CF_NOEURO,"CHF ",    "" }, // swiss franc
-{ 480, ',', 2002,         "", "Dr." }, // greek drachma
+{ 50,  ',', CF_NOEURO,    "", " Kc" }, // czech koruna // TODO: Should use the "c" with an upside down "^"
 { 4,   '.', 2002,      "DM ",    "" }, // deutsche mark
+{ 10,  '.', CF_NOEURO,    "", " kr" }, // danish krone
+{ 200, '.', 2002,     "Pts ",    "" }, // spanish pesetas
+{ 8,   ',', 2002,         "", " MK" }, // finnish markka
 { 10,  '.', 2002,      "FF ",    "" }, // french francs
+{ 480, ',', 2002,         "", "Dr." }, // greek drachma
 { 376, ',', 2002,         "", " Ft" }, // forint
-{ 50,  ',', CF_NOEURO,    "", " Kc" }, // czech koruna // TODO: Should use the "c" with an upside down "^"
-{ 13,  '.', CF_NOEURO,    "", " Kr" }, // swedish krona
 { 130, '.', CF_NOEURO,    "", " Kr" }, // icelandic krona
+{ 2730,',', 2002,         "", " L." }, // italian lira
+{ 3,   ',', 2002,     "NLG ",    "" }, // dutch gulden
 { 11,  '.', CF_NOEURO,    "", " Kr" }, // norwegian krone
-{ 10,  '.', CF_NOEURO,    "", " kr" }, // danish krone
-{ 2730,',', 2002,         "", " L." }, // italian lira
+{ 6,   ' ', CF_NOEURO,    "", " zl" }, // polish zloty
 { 6,   '.', CF_NOEURO,    ""," Lei" }, // romanian Lei
-{ 8,   ',', 2002,         "", " MK" }, // finnish markka
-{ 3,   ',', 2002,     "NLG ",    "" }, // dutch gulden
 { 5,   ' ', CF_NOEURO,    "",  " p" }, // russian rouble
-{ 200, '.', 2002,     "Pts ",    "" }, // spanish pesetas
-{ 19,  ',', 2002,         "", " S." }, // austrian schilling
-{ 6,   ' ', CF_NOEURO,    "", " zl" }, // polish zloty
+{ 13,  '.', CF_NOEURO,    "", " Kr" }, // swedish krona
 { 1,   ' ', CF_NOEURO,    "",    "" }, // custom currency
 };
+
--- a/ttd.c	Wed Dec 22 19:16:56 2004 +0000
+++ b/ttd.c	Wed Dec 22 19:48:27 2004 +0000
@@ -1185,7 +1185,7 @@
 	*/
 }
 
-byte covert_currency[] = {
+byte convert_currency[] = {
 	 0,  1, 12,  8,  3,
 	10, 14, 19,  4,  5,
 	 9, 11, 13,  6, 17,
@@ -1195,7 +1195,7 @@
 // since savegame version 4.2 the currencies are arranged differently
 void UpdateCurrencies()
 {
-	_opt.currency = covert_currency[_opt.currency];
+	_opt.currency = convert_currency[_opt.currency];
 }
 
 extern void UpdateOldAircraft();