diff options
author | Darkvater <Darkvater@openttd.org> | 2005-09-16 10:37:21 +0000 |
---|---|---|
committer | Darkvater <Darkvater@openttd.org> | 2005-09-16 10:37:21 +0000 |
commit | 4d7e916a096f35d6997a36c68315483472d4f6b3 (patch) | |
tree | f94be8f3cb6816c890e8f9b4b8071ca246195307 /namegen.c | |
parent | 78e4cbbfda606a6f23329dfaffb7adf6f1581b0f (diff) | |
download | openttd-4d7e916a096f35d6997a36c68315483472d4f6b3.tar.xz |
(svn r2957) - Feature: [ 1263280 ] Danish town names (fey_dk)
Diffstat (limited to 'namegen.c')
-rw-r--r-- | namegen.c | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -573,6 +573,25 @@ static byte MakeSwissTownName(char *buf, uint32 seed) return 0; } +static byte MakeDanishTownName(char *buf, uint32 seed) +{ + int i; + + // null terminates the string for strcat + strcpy(buf, ""); + + // optional first segment + i = SeedChanceBias(0, lengthof(name_danish_1), seed, 50); + if (i >= 0) + strcat(buf, name_danish_1[i]); + + // middle segments removed as this algorithm seems to create much more realistic names + strcat(buf, name_danish_2[SeedChance( 7, lengthof(name_danish_2), seed)]); + strcat(buf, name_danish_3[SeedChance(16, lengthof(name_danish_3), seed)]); + + return 0; +} + TownNameGenerator * const _town_name_generators[] = { MakeEnglishOriginalTownName, @@ -592,6 +611,7 @@ TownNameGenerator * const _town_name_generators[] = MakeRomanianTownName, MakeCzechTownName, MakeSwissTownName, + MakeDanishTownName, }; // DO WE NEED THIS ANY MORE? |