diff options
author | belugas <belugas@openttd.org> | 2006-07-17 20:27:17 +0000 |
---|---|---|
committer | belugas <belugas@openttd.org> | 2006-07-17 20:27:17 +0000 |
commit | 507cc6146e7749591b1966a50735ab125666db10 (patch) | |
tree | 84eb77665fd35109ac171a04702d708c3c524a62 | |
parent | c76b718e36a8c3eaa6478b185359a5ef67f1e7d7 (diff) | |
download | openttd-507cc6146e7749591b1966a50735ab125666db10.tar.xz |
(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
-rw-r--r-- | namegen.c | 33 |
1 files changed, 15 insertions, 18 deletions
@@ -647,45 +647,42 @@ static byte MakeTurkishTownName(char *buf, uint32 seed) 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)]); } |