1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-15 08:22:34 +01:00

Fix #14763: Crash if NewGRF currency separator is not valid. (#14764)

Ensure separator is a valid string.
This commit is contained in:
Peter Nelson
2025-11-09 08:21:55 +00:00
committed by GitHub
parent f052ef213e
commit d48463d2be

View File

@@ -178,6 +178,7 @@ static ChangeInfoResult GlobalVarChangeInfo(uint first, uint last, int prop, Byt
if (curidx < CURRENCY_END) {
_currency_specs[curidx].separator.clear();
_currency_specs[curidx].separator.push_back(GB(options, 0, 8));
StrMakeValidInPlace(_currency_specs[curidx].separator);
/* 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);