summaryrefslogtreecommitdiff
path: root/src/strings.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2007-06-24 22:42:11 +0000
committerpeter1138 <peter1138@openttd.org>2007-06-24 22:42:11 +0000
commitfc7418d19d831e7ebc0e7c5b5651d58e76158fe0 (patch)
treed9368d95af8a7f09cc32a4f7eb328fb63e863059 /src/strings.cpp
parentce91598e3ce045fcc3aeed3a3f07821d96605e9f (diff)
downloadopenttd-fc7418d19d831e7ebc0e7c5b5651d58e76158fe0.tar.xz
(svn r10314) -Codechange: Refer to vehicle names by index
Diffstat (limited to 'src/strings.cpp')
-rw-r--r--src/strings.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/strings.cpp b/src/strings.cpp
index bb97c899c..2b1c5bb44 100644
--- a/src/strings.cpp
+++ b/src/strings.cpp
@@ -29,6 +29,7 @@
#include "group.h"
#include "debug.h"
#include "newgrf_townname.h"
+#include "vehicle.h"
/* for opendir/readdir/closedir */
# include "fios.h"
@@ -861,6 +862,16 @@ static char* FormatString(char* buff, const char* str, const int64* argv, uint c
break;
}
+ case SCC_VEHICLE_NAME: { // {VEHICLE}
+ const Vehicle *v = GetVehicle(GetInt32(&argv));
+
+ int64 args[1];
+ args[0] = v->unitnumber;
+
+ buff = GetStringWithArgs(buff, v->string_id, args, last);
+ break;
+ }
+
case SCC_SETCASE: { // {SETCASE}
/* This is a pseudo command, it's outputted when someone does {STRING.ack}
* The modifier is added to all subsequent GetStringWithArgs that accept the modifier. */