diff options
author | planetmaker <planetmaker@openttd.org> | 2013-03-09 16:16:17 +0000 |
---|---|---|
committer | planetmaker <planetmaker@openttd.org> | 2013-03-09 16:16:17 +0000 |
commit | c22bbf5293d5727a061ed9839d8ab397710b81d0 (patch) | |
tree | 4cecdc676abac4ad4e40c898a73e18c7f479c94c /src/newgrf.cpp | |
parent | 54915063f041d552f2eb86e39bd1637cacbaa32b (diff) | |
download | openttd-c22bbf5293d5727a061ed9839d8ab397710b81d0.tar.xz |
(svn r25072) -Codechange: Don't require the custom currency to be the last defined one
Diffstat (limited to 'src/newgrf.cpp')
-rw-r--r-- | src/newgrf.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp index a1dfd7917..f56b99899 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -2487,7 +2487,7 @@ static ChangeInfoResult GlobalVarChangeInfo(uint gvid, int numinfo, int prop, By uint curidx = GetNewgrfCurrencyIdConverted(gvid + i); StringID newone = GetGRFStringID(_cur.grffile->grfid, buf->ReadWord()); - if ((newone != STR_UNDEFINED) && (curidx < NUM_CURRENCY)) { + if ((newone != STR_UNDEFINED) && (curidx < CURRENCY_END)) { _currency_specs[curidx].name = newone; } break; @@ -2497,7 +2497,7 @@ static ChangeInfoResult GlobalVarChangeInfo(uint gvid, int numinfo, int prop, By uint curidx = GetNewgrfCurrencyIdConverted(gvid + i); uint32 rate = buf->ReadDWord(); - if (curidx < NUM_CURRENCY) { + if (curidx < CURRENCY_END) { /* 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 */ @@ -2512,7 +2512,7 @@ static ChangeInfoResult GlobalVarChangeInfo(uint gvid, int numinfo, int prop, By uint curidx = GetNewgrfCurrencyIdConverted(gvid + i); uint16 options = buf->ReadWord(); - if (curidx < NUM_CURRENCY) { + if (curidx < CURRENCY_END) { _currency_specs[curidx].separator[0] = GB(options, 0, 8); _currency_specs[curidx].separator[1] = '\0'; /* By specifying only one bit, we prevent errors, @@ -2528,7 +2528,7 @@ static ChangeInfoResult GlobalVarChangeInfo(uint gvid, int numinfo, int prop, By uint curidx = GetNewgrfCurrencyIdConverted(gvid + i); uint32 tempfix = buf->ReadDWord(); - if (curidx < NUM_CURRENCY) { + if (curidx < CURRENCY_END) { memcpy(_currency_specs[curidx].prefix, &tempfix, 4); _currency_specs[curidx].prefix[4] = 0; } else { @@ -2541,7 +2541,7 @@ static ChangeInfoResult GlobalVarChangeInfo(uint gvid, int numinfo, int prop, By uint curidx = GetNewgrfCurrencyIdConverted(gvid + i); uint32 tempfix = buf->ReadDWord(); - if (curidx < NUM_CURRENCY) { + if (curidx < CURRENCY_END) { memcpy(&_currency_specs[curidx].suffix, &tempfix, 4); _currency_specs[curidx].suffix[4] = 0; } else { @@ -2554,7 +2554,7 @@ static ChangeInfoResult GlobalVarChangeInfo(uint gvid, int numinfo, int prop, By uint curidx = GetNewgrfCurrencyIdConverted(gvid + i); Year year_euro = buf->ReadWord(); - if (curidx < NUM_CURRENCY) { + if (curidx < CURRENCY_END) { _currency_specs[curidx].to_euro = year_euro; } else { grfmsg(1, "GlobalVarChangeInfo: Euro intro date %d out of range, ignoring", curidx); |