mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r1233) Fixed several currency issues. Now currencies should work correctly again.
This commit is contained in:
parent
51cbbd0438
commit
e297eada07
|
@ -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 @@ uint GetMaskOfAllowedCurrencies()
|
|||
return mask;
|
||||
}
|
||||
|
||||
void CheckSwitchToEuro()
|
||||
void CheckSwitchToEuro(void)
|
||||
{
|
||||
if (_currency_specs[_opt.currency].to_euro != CF_NOEURO &&
|
||||
_currency_specs[_opt.currency].to_euro != CF_ISEURO &&
|
||||
|
|
|
@ -2733,7 +2733,7 @@ STR_NEWGRF_FILENAME :{BLACK}Filename:
|
|||
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:
|
||||
|
|
|
@ -7,24 +7,26 @@ CurrencySpec _currency_specs[] = {
|
|||
{ 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
|
||||
{ 4, '.', 2002, "DM ", "" }, // deutsche mark
|
||||
{ 10, '.', 2002, "FF ", "" }, // french francs
|
||||
{ 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
|
||||
{ 11, '.', CF_NOEURO, "", " Kr" }, // norwegian krone
|
||||
{ 4, '.', 2002, "DM ", "" }, // deutsche mark
|
||||
{ 10, '.', CF_NOEURO, "", " kr" }, // danish krone
|
||||
{ 2730,',', 2002, "", " L." }, // italian lira
|
||||
{ 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
|
||||
{ 8, ',', 2002, "", " MK" }, // finnish markka
|
||||
{ 10, '.', 2002, "FF ", "" }, // french francs
|
||||
{ 480, ',', 2002, "", "Dr." }, // greek drachma
|
||||
{ 376, ',', 2002, "", " Ft" }, // forint
|
||||
{ 130, '.', CF_NOEURO, "", " Kr" }, // icelandic krona
|
||||
{ 2730,',', 2002, "", " L." }, // italian lira
|
||||
{ 3, ',', 2002, "NLG ", "" }, // dutch gulden
|
||||
{ 11, '.', CF_NOEURO, "", " Kr" }, // norwegian krone
|
||||
{ 6, ' ', CF_NOEURO, "", " zl" }, // polish zloty
|
||||
{ 6, '.', CF_NOEURO, ""," Lei" }, // romanian Lei
|
||||
{ 5, ' ', CF_NOEURO, "", " p" }, // russian rouble
|
||||
{ 13, '.', CF_NOEURO, "", " Kr" }, // swedish krona
|
||||
{ 1, ' ', CF_NOEURO, "", "" }, // custom currency
|
||||
};
|
||||
|
||||
|
|
4
ttd.c
4
ttd.c
|
@ -1185,7 +1185,7 @@ void UpdateExclusiveRights()
|
|||
*/
|
||||
}
|
||||
|
||||
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 @@ byte covert_currency[] = {
|
|||
// 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();
|
||||
|
|
Loading…
Reference in New Issue