diff options
author | belugas <belugas@openttd.org> | 2006-09-15 02:52:17 +0000 |
---|---|---|
committer | belugas <belugas@openttd.org> | 2006-09-15 02:52:17 +0000 |
commit | d1508bbd6cbcf991fffe03d41918f177a6cec330 (patch) | |
tree | 0d7242b1c537ae7e104d4a21a28cdbf998409ea0 /newgrf.c | |
parent | 326e74055e62ee6cc26a7eb39fdb5c6beb49f85f (diff) | |
download | openttd-d1508bbd6cbcf991fffe03d41918f177a6cec330.tar.xz |
(svn r6454) -Fix(r6108) : Allow custom currency to display both prefix and suffix
-Codechange : Divide rate of conversion from grf by 1000, to match OTTD internal system
Diffstat (limited to 'newgrf.c')
-rw-r--r-- | newgrf.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -1105,7 +1105,10 @@ static bool GlobalVarChangeInfo(uint gvid, int numinfo, int prop, byte **bufp, i uint32 rate = grf_load_dword(&buf); if (curidx < NUM_CURRENCY) { - _currency_specs[curidx].rate = rate; + /* TTDPatch uses a multiple of 1000 for its conversion calculations, + * which OTTD does not. For this reason, divide grf value by 1000, + * to be compatible */ + _currency_specs[curidx].rate = rate / 1000; } else { grfmsg(GMS_WARN, "GlobalVarChangeInfo: Currency multipliers %d out of range, ignoring.", curidx); } @@ -1119,14 +1122,16 @@ static bool GlobalVarChangeInfo(uint gvid, int numinfo, int prop, byte **bufp, i if (curidx < NUM_CURRENCY) { _currency_specs[curidx].separator = GB(options, 0, 8); - _currency_specs[curidx].symbol_pos = GB(options, 8, 8); + /* By specifying only one bit, we prevent errors, + * since newgrf specs said that only 0 and 1 can be set for symbol_pos */ + _currency_specs[curidx].symbol_pos = GB(options, 8, 1); } else { grfmsg(GMS_WARN, "GlobalVarChangeInfo: Currency option %d out of range, ignoring.", curidx); } } break; - case 0x0D: // Currency symbols + case 0x0D: // Currency prefix symbol FOR_EACH_OBJECT { uint curidx = gvid +i; uint32 tempfix = grf_load_dword(&buf); @@ -1140,7 +1145,7 @@ static bool GlobalVarChangeInfo(uint gvid, int numinfo, int prop, byte **bufp, i } break; - case 0x0E: // Currency symbols + case 0x0E: // Currency suffix symbol FOR_EACH_OBJECT { uint curidx = gvid +i; uint32 tempfix = grf_load_dword(&buf); |