(svn r1926) Codechange: Renamed some of the predefined town names arrays for consistent naming.

- name_spanish_1, name_french_1, name_czech_1, name_romanian_1, name_finnish_1
  and name_german_hardcoded were renamed to *_real.
- name_slovakish_1 was renamed to name_slovak_real.
- name_finnish_2[ab] was renamed to name_finnish[12].
- Added comment near the town_names setting definition about the "Slovakish"
  pigginess.
This commit is contained in:
pasky 2005-03-05 14:54:11 +00:00
parent b5a96ff9c1
commit 01fd7eb861
3 changed files with 25 additions and 23 deletions

View File

@ -160,11 +160,11 @@ static byte MakeGermanTownName(char *buf, uint32 seed)
}
// mandatory middle segments including option of hardcoded name
i = SeedChance(3, lengthof(name_german_hardcoded) + lengthof(name_german_1), seed);
if (i < lengthof(name_german_hardcoded)) {
strcat(buf,name_german_hardcoded[i]);
i = SeedChance(3, lengthof(name_german_real) + lengthof(name_german_1), seed);
if (i < lengthof(name_german_real)) {
strcat(buf,name_german_real[i]);
} else {
strcat(buf, name_german_1[i - lengthof(name_german_hardcoded)]);
strcat(buf, name_german_1[i - lengthof(name_german_real)]);
i = SeedChance(5, lengthof(name_german_2), seed);
strcat(buf, name_german_2[i]);
@ -187,13 +187,13 @@ static byte MakeGermanTownName(char *buf, uint32 seed)
static byte MakeSpanishTownName(char *buf, uint32 seed)
{
strcpy(buf, name_spanish_1[SeedChance(0, lengthof(name_spanish_1), seed)]);
strcpy(buf, name_spanish_real[SeedChance(0, lengthof(name_spanish_real), seed)]);
return 0;
}
static byte MakeFrenchTownName(char *buf, uint32 seed)
{
strcpy(buf, name_french_1[SeedChance(0, lengthof(name_french_1), seed)]);
strcpy(buf, name_french_real[SeedChance(0, lengthof(name_french_real), seed)]);
return 0;
}
@ -261,10 +261,10 @@ static byte MakeFinnishTownName(char *buf, uint32 seed)
// Select randomly if town name should consists of one or two parts.
if (SeedChance(0, 15, seed) >= 10) {
strcat(buf, name_finnish_1[SeedChance( 2, lengthof(name_finnish_1), seed)]);
strcat(buf, name_finnish_real[SeedChance( 2, lengthof(name_finnish_real), seed)]);
} else {
strcat(buf, name_finnish_2a[SeedChance( 2, lengthof(name_finnish_2a), seed)]);
strcat(buf, name_finnish_2b[SeedChance(10, lengthof(name_finnish_2b), seed)]);
strcat(buf, name_finnish_1[SeedChance( 2, lengthof(name_finnish_1), seed)]);
strcat(buf, name_finnish_2[SeedChance(10, lengthof(name_finnish_2), seed)]);
}
return 0;
@ -318,19 +318,19 @@ static byte MakePolishTownName(char *buf, uint32 seed)
static byte MakeCzechTownName(char *buf, uint32 seed)
{
strcpy(buf, name_czech_1[SeedChance(0, lengthof(name_czech_1), seed)]);
strcpy(buf, name_czech_real[SeedChance(0, lengthof(name_czech_real), seed)]);
return 0;
}
static byte MakeRomanianTownName(char *buf, uint32 seed)
{
strcpy(buf, name_romanian_1[SeedChance(0, lengthof(name_romanian_1), seed)]);
strcpy(buf, name_romanian_real[SeedChance(0, lengthof(name_romanian_real), seed)]);
return 0;
}
static byte MakeSlovakTownName(char *buf, uint32 seed)
{
strcpy(buf, name_slovakish_1[SeedChance(0, lengthof(name_slovakish_1), seed)]);
strcpy(buf, name_slovak_real[SeedChance(0, lengthof(name_slovak_real), seed)]);
return 0;
}
@ -422,7 +422,7 @@ uint32 GetOldTownName(uint32 townnameparts, byte old_town_name_type)
case 1: /* French */
/* For some reason 86 needs to be subtracted from townnameparts
* 0000 0000 0000 0000 0000 0000 1111 1111 */
return FIXNUM(townnameparts - 86, lengthof(name_french_1), 0);
return FIXNUM(townnameparts - 86, lengthof(name_french_real), 0);
case 2: /* German */
DEBUG(misc, 0) ("German Townnames are buggy... (%d)", townnameparts);
@ -430,7 +430,7 @@ uint32 GetOldTownName(uint32 townnameparts, byte old_town_name_type)
case 4: /* Latin-American */
/* 0000 0000 0000 0000 0000 0000 1111 1111 */
return FIXNUM(townnameparts, lengthof(name_spanish_1), 0);
return FIXNUM(townnameparts, lengthof(name_spanish_real), 0);
case 5: /* Silly */
/* NUM_SILLY_1 - lower 16 bits

View File

@ -787,6 +787,8 @@ static const SettingDesc gameopt_settings[] = {
{"diff_custom", SDT_INTLIST | SDT_UINT32 | (sizeof(GameDifficulty)/4) << 16, NULL, &_new_opt.diff, NULL},
{"currency", SDT_UINT8 | SDT_ONEOFMANY, (void*)0, &_new_opt.currency, "GBP|USD|EUR|YEN|ATS|BEF|CHF|CZK|DEM|DKK|ESP|FIM|FRF|GRD|HUF|ISK|ITL|NLG|NOK|PLN|ROL|RUR|SEK|custom" },
{"distances", SDT_UINT8 | SDT_ONEOFMANY, (void*)1, &_new_opt.kilometers, "imperial|metric" },
// XXX: Slovakish is an awful nonsense. It is either Slovak or
// Slovakian, I personally prefer the former. --pasky
{"town_names", SDT_UINT8 | SDT_ONEOFMANY, (void*)0, &_new_opt.town_name, "english|french|german|american|latin|silly|swedish|dutch|finnish|polish|slovakish|norwegian|hungarian|austrian|romanian|czech|swiss" },
{"landscape", SDT_UINT8 | SDT_ONEOFMANY, (void*)0, &_new_opt.landscape, "normal|hilly|desert|candy" },
{"autosave", SDT_UINT8 | SDT_ONEOFMANY, (void*)1, &_new_opt.autosave, "off|monthly|quarterly|half year|yearly" },

View File

@ -443,7 +443,7 @@ static const char *name_austrian_b2[] = {
"Ziller"
};
static const char *name_german_hardcoded[] = {
static const char *name_german_real[] = {
"Berlin",
"Bonn",
"Bremen",
@ -608,7 +608,7 @@ static const char *name_german_4_am[] = {
"Main"
};
static const char *name_spanish_1[] = {
static const char *name_spanish_real[] = {
"Caracas",
"Maracay",
"Maracaibo",
@ -697,7 +697,7 @@ static const char *name_spanish_1[] = {
"Santa Rosa"
};
static const char *name_french_1[] = {
static const char *name_french_real[] = {
"Agincourt",
"Lille",
"Dinan",
@ -1206,7 +1206,7 @@ static const char *name_dutch_5[] = {
"end"
};
static const char *name_finnish_1[] = {
static const char *name_finnish_real[] = {
"Aijala",
"Kisko",
"Espoo",
@ -1234,7 +1234,7 @@ static const char *name_finnish_1[] = {
"Pasila"
};
static const char *name_finnish_2a[] = {
static const char *name_finnish_1[] = {
"Hiekka",
"Haapa",
"Mylly",
@ -1263,7 +1263,7 @@ static const char *name_finnish_2a[] = {
"Koivu"
};
static const char *name_finnish_2b[] = {
static const char *name_finnish_2[] = {
"harju",
"linna",
"järvi",
@ -1574,7 +1574,7 @@ static const char *name_polish_3_n[] = {
" Lesne"
};
static const char *name_czech_1[] = {
static const char *name_czech_real[] = {
"As",
"Benesov",
"Beroun",
@ -1659,7 +1659,7 @@ static const char *name_czech_1[] = {
"Znojmo"
};
static const char *name_romanian_1[]= {
static const char *name_romanian_real[]= {
"Adjud",
"Alba Iulia",
"Alexandria",
@ -1756,7 +1756,7 @@ static const char *name_romanian_1[]= {
"Zalãu"
};
static const char *name_slovakish_1[] = {
static const char *name_slovak_real[] = {
"Bratislava",
"Banovce nad Bebravou",
"Banska Bystrica",