Codechange: turn a constant variable into a real constant.

This commit is contained in:
frosch
2021-01-12 22:11:12 +01:00
committed by frosch
parent d17226910d
commit 4ce941bbc2
3 changed files with 15 additions and 18 deletions

View File

@@ -1841,15 +1841,10 @@ static void DoCreateTown(Town *t, TileIndex tile, uint32 townnameparts, TownSize
t->exclusive_counter = 0;
t->statues = 0;
extern int _nb_orig_names;
if (_settings_game.game_creation.town_name < _nb_orig_names) {
/* Original town name */
t->townnamegrfid = 0;
t->townnametype = SPECSTR_TOWNNAME_START + _settings_game.game_creation.town_name;
} else {
/* Newgrf town name */
t->townnamegrfid = GetGRFTownNameId(_settings_game.game_creation.town_name - _nb_orig_names);
t->townnametype = GetGRFTownNameType(_settings_game.game_creation.town_name - _nb_orig_names);
{
TownNameParams tnp(_settings_game.game_creation.town_name);
t->townnamegrfid = tnp.grfid;
t->townnametype = tnp.type;
}
t->townnameparts = townnameparts;