diff options
author | celestar <celestar@openttd.org> | 2006-05-01 09:25:23 +0000 |
---|---|---|
committer | celestar <celestar@openttd.org> | 2006-05-01 09:25:23 +0000 |
commit | 5c677d49f47011769c56c6019d2ae180d852778c (patch) | |
tree | ffc556fa2c8a008977f660b62a0e3ae8c0ec1206 /namegen.c | |
parent | 9fc8d0fb924517836d1d342548aa76c950b1a942 (diff) | |
download | openttd-5c677d49f47011769c56c6019d2ae180d852778c.tar.xz |
(svn r4639) -Feature: Turkish town names (jnmbk)
Diffstat (limited to 'namegen.c')
-rw-r--r-- | namegen.c | 29 |
1 files changed, 29 insertions, 0 deletions
@@ -620,6 +620,34 @@ static byte MakeDanishTownName(char *buf, uint32 seed) return 0; } +static byte MakeTurkishTownName(char *buf, uint32 seed) +{ + uint i; + + // null terminates the string for strcat + strcpy(buf, ""); + + if ((i = SeedModChance(0, 5, seed)) == 0) { + strcat(buf, name_turkish_prefix[SeedModChance( 2, lengthof(name_turkish_prefix), seed)]); + + // middle segment + strcat(buf, name_turkish_middle[SeedModChance( 4, lengthof(name_turkish_middle), seed)]); + + // optional suffix + if (SeedModChance(0, 7, seed) == 0) { + strcat(buf, name_turkish_suffix[SeedModChance( 10, lengthof(name_turkish_suffix), seed)]); + } + } else { + if (i == 1 || i == 2) { + strcat(buf, name_turkish_prefix[SeedModChance( 2, lengthof(name_turkish_prefix), seed)]); + strcat(buf, name_turkish_suffix[SeedModChance( 4, lengthof(name_turkish_suffix), seed)]); + } else { + strcat(buf, name_turkish_real[SeedModChance( 4, lengthof(name_turkish_real), seed)]); + } + } + return 0; +} + TownNameGenerator * const _town_name_generators[] = { MakeEnglishOriginalTownName, @@ -640,6 +668,7 @@ TownNameGenerator * const _town_name_generators[] = MakeCzechTownName, MakeSwissTownName, MakeDanishTownName, + MakeTurkishTownName, }; // DO WE NEED THIS ANY MORE? |