1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-09-01 19:09:09 +00:00

(svn r10314) -Codechange: Refer to vehicle names by index

This commit is contained in:
2007-06-24 22:42:11 +00:00
parent ce91598e3c
commit fc7418d19d
13 changed files with 43 additions and 36 deletions

View File

@@ -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. */