summaryrefslogtreecommitdiff
path: root/src/strings.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-05-12 18:19:36 +0000
committerrubidium <rubidium@openttd.org>2010-05-12 18:19:36 +0000
commit5051ef80c663e252ed6867b3cd0298d3b1c8717c (patch)
tree92906fbbf435190a120e62033f0d4bb413f9a35f /src/strings.cpp
parent007c9641a6706abc3afc84fda542b1915dc21d35 (diff)
downloadopenttd-5051ef80c663e252ed6867b3cd0298d3b1c8717c.tar.xz
(svn r19796) -Codechange: introduce and use a {DEPOT} string command
Diffstat (limited to 'src/strings.cpp')
-rw-r--r--src/strings.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/strings.cpp b/src/strings.cpp
index 3f4339153..1f9d96096 100644
--- a/src/strings.cpp
+++ b/src/strings.cpp
@@ -15,6 +15,7 @@
#include "town.h"
#include "screenshot.h"
#include "waypoint_base.h"
+#include "depot_base.h"
#include "industry.h"
#include "newgrf_text.h"
#include "fileio_func.h"
@@ -944,6 +945,13 @@ static char *FormatString(char *buff, const char *str, int64 *argv, uint casei,
break;
}
+ case SCC_DEPOT_NAME: { // {DEPOT}
+ VehicleType vt = (VehicleType)GetInt32(&argv);
+ int64 temp[1] = { vt == VEH_AIRCRAFT ? GetInt32(&argv) : Depot::Get(GetInt32(&argv))->town_index };
+ buff = GetStringWithArgs(buff, STR_FORMAT_DEPOT_NAME_TRAIN + vt, temp, last);
+ break;
+ }
+
case SCC_TOWN_NAME: { // {TOWN}
const Town *t = Town::Get(GetInt32(&argv));