1
0
Fork 0

Codechange: prefer SPECSTR_TOWNNAME_START over _ENGLISH

pull/13280/head
Rubidium 2025-01-04 10:54:14 +01:00 committed by rubidium42
parent 65731bb964
commit ed36305d29
3 changed files with 5 additions and 5 deletions

View File

@ -119,6 +119,6 @@ uint16_t GetGRFTownNameType(uint16_t gen)
if (gen < t.styles.size()) return gen; if (gen < t.styles.size()) return gen;
gen -= static_cast<uint16_t>(t.styles.size()); gen -= static_cast<uint16_t>(t.styles.size());
} }
/* Fallback to english original */ /* Fallback to the first built in town name (English). */
return SPECSTR_TOWNNAME_ENGLISH; return SPECSTR_TOWNNAME_START;
} }

View File

@ -147,7 +147,7 @@ static void FixOldTowns()
/* Convert town-names if needed */ /* Convert town-names if needed */
for (Town *town : Town::Iterate()) { for (Town *town : Town::Iterate()) {
if (IsInsideMM(town->townnametype, 0x20C1, 0x20C3)) { if (IsInsideMM(town->townnametype, 0x20C1, 0x20C3)) {
town->townnametype = SPECSTR_TOWNNAME_ENGLISH + _settings_game.game_creation.town_name; town->townnametype = SPECSTR_TOWNNAME_START + _settings_game.game_creation.town_name;
town->townnameparts = RemapOldTownName(town->townnameparts, _settings_game.game_creation.town_name); town->townnameparts = RemapOldTownName(town->townnameparts, _settings_game.game_creation.town_name);
} }
} }

View File

@ -31,9 +31,9 @@ TownNameParams::TownNameParams(const Town *t) :
type(t->townnametype) type(t->townnametype)
{ {
if (t->townnamegrfid != 0 && GetGRFTownName(t->townnamegrfid) == nullptr) { if (t->townnamegrfid != 0 && GetGRFTownName(t->townnamegrfid) == nullptr) {
/* Fallback to english original */ /* Fallback to the first built in town name (English). */
this->grfid = 0; this->grfid = 0;
this->type = SPECSTR_TOWNNAME_ENGLISH; this->type = SPECSTR_TOWNNAME_START;
return; return;
} }
} }