Mercurial > hg > openttd
changeset 4148:fc54f918b30e draft
(svn r5512) Fix : Remove a warning on MakeItalianTownName.
While at it, adjust the different parts of the generator.
Now, masculin is not linked to generic suffix,
and feminin is not linked to river-name suffix
author | belugas <belugas@openttd.org> |
---|---|
date | Mon, 17 Jul 2006 20:27:17 +0000 |
parents | e339e71f28a8 |
children | 83e95d6cc8b2 |
files | namegen.c |
diffstat | 1 files changed, 15 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/namegen.c +++ b/namegen.c @@ -647,45 +647,42 @@ return 0; } +static const char *mascul_femin_italian[] = { + "o", + "a", +}; + static byte MakeItalianTownName(char *buf, uint32 seed) { - byte i; - char *c; strcpy(buf, ""); - if (SeedModChance(0, 6, seed) == 0) { - // real city names + if (SeedModChance(0, 6, seed) == 0) { // real city names strcat(buf, name_italian_real[SeedModChance(4, lengthof(name_italian_real), seed)]); } else { - if (SeedModChance(0, 8, seed) == 0) { - // prefix + uint i; + + if (SeedModChance(0, 8, seed) == 0) { // prefix strcat(buf, name_italian_pref[SeedModChance(11, lengthof(name_italian_pref), seed)]); } - i = SeedModChance(0, 2, seed); + i = SeedChance(0, 2, seed); if (i == 0) { // masculine form strcat(buf, name_italian_1m[SeedModChance(4, lengthof(name_italian_1m), seed)]); - c = "o"; - } else { // femminine form + } else { // feminine form strcat(buf, name_italian_1f[SeedModChance(4, lengthof(name_italian_1f), seed)]); - c = "a"; } - if (SeedModChance(0, 3, seed) == 0) { + if (SeedModChance(3, 3, seed) == 0) { strcat(buf, name_italian_2[SeedModChance(11, lengthof(name_italian_2), seed)]); - strcat(buf,c); + strcat(buf,mascul_femin_italian[i]); } else { strcat(buf, name_italian_2i[SeedModChance(16, lengthof(name_italian_2i), seed)]); } - if (SeedModChance(15, 4, seed) == 0) { - if (SeedModChance(0, 2, seed) == 0) { - // generic suffix + if (SeedModChance(5, 2, seed) == 0) { // generic suffix strcat(buf, name_italian_3[SeedModChance(4, lengthof(name_italian_3), seed)]); - } - else { - // river name suffix + } else { // river name suffix strcat(buf, name_italian_river1[SeedModChance(4, lengthof(name_italian_river1), seed)]); strcat(buf, name_italian_river2[SeedModChance(16, lengthof(name_italian_river2), seed)]); }