mirror of https://github.com/OpenTTD/OpenTTD
(svn r26262) -Fix (r25075, r25076): Custom currency was reset on game start.
parent
1213e6ba71
commit
e3947c8019
|
@ -144,14 +144,14 @@ void CheckSwitchToEuro()
|
||||||
* Will fill _currency_specs array with
|
* Will fill _currency_specs array with
|
||||||
* default values from origin_currency_specs
|
* default values from origin_currency_specs
|
||||||
* Called only from newgrf.cpp and settings.cpp.
|
* Called only from newgrf.cpp and settings.cpp.
|
||||||
* @param preserve_custom will not reset custom currency (the latest one on the list)
|
* @param preserve_custom will not reset custom currency
|
||||||
* if ever it is flagged to true. In which case, the total size of the memory to move
|
|
||||||
* will be one currency spec less, thus preserving the custom currency from been
|
|
||||||
* overwritten.
|
|
||||||
*/
|
*/
|
||||||
void ResetCurrencies(bool preserve_custom)
|
void ResetCurrencies(bool preserve_custom)
|
||||||
{
|
{
|
||||||
memcpy(&_currency_specs, &origin_currency_specs, sizeof(origin_currency_specs) - (preserve_custom ? sizeof(_custom_currency) : 0));
|
for (uint i = 0; i < CURRENCY_END; i++) {
|
||||||
|
if (preserve_custom && i == CURRENCY_CUSTOM) continue;
|
||||||
|
_currency_specs[i] = origin_currency_specs[i];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue