diff options
author | rubidium <rubidium@openttd.org> | 2010-05-12 20:50:10 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2010-05-12 20:50:10 +0000 |
commit | 1a5d7b34d8788340f348dc51a3809155b50b2595 (patch) | |
tree | 085f25035601ee9209149d209595d593e5baee51 /src/strings.cpp | |
parent | e91165ef6e907c7868ecf994c91b16bc9960fbf9 (diff) | |
download | openttd-1a5d7b34d8788340f348dc51a3809155b50b2595.tar.xz |
(svn r19801) -Add [FS#3691]: custom naming of depots. Based on work by sbr
Diffstat (limited to 'src/strings.cpp')
-rw-r--r-- | src/strings.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/strings.cpp b/src/strings.cpp index 6e1130227..56ed57f71 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -950,8 +950,13 @@ static char *FormatString(char *buff, const char *str, int64 *argv, uint casei, if (vt == VEH_AIRCRAFT) { int64 temp[] = { GetInt32(&argv) }; buff = GetStringWithArgs(buff, STR_FORMAT_DEPOT_NAME_AIRCRAFT + vt, temp, last); + break; + } + + const Depot *d = Depot::Get(GetInt32(&argv)); + if (d->name != NULL) { + buff = strecpy(buff, d->name, last); } else { - const Depot *d = Depot::Get(GetInt32(&argv)); int64 temp[] = { d->town->index, d->town_cn + 1 }; buff = GetStringWithArgs(buff, STR_FORMAT_DEPOT_NAME_TRAIN + 2 * vt + (d->town_cn == 0 ? 0 : 1), temp, last); } |