(svn r19796) -Codechange: introduce and use a {DEPOT} string command

This commit is contained in:
rubidium
2010-05-12 18:19:36 +00:00
parent 007c9641a6
commit 5051ef80c6
7 changed files with 52 additions and 74 deletions

View File

@@ -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));