1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-23 06:29:11 +00:00

(svn r19799) -Change: give depots an unique name in the same manner buoys and waypoints are named

This commit is contained in:
rubidium
2010-05-12 19:21:00 +00:00
parent 863ff6522b
commit 93ff7d78e1
11 changed files with 64 additions and 14 deletions

View File

@@ -947,8 +947,14 @@ static char *FormatString(char *buff, const char *str, int64 *argv, uint casei,
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);
if (vt == VEH_AIRCRAFT) {
int64 temp[] = { GetInt32(&argv) };
buff = GetStringWithArgs(buff, STR_FORMAT_DEPOT_NAME_AIRCRAFT + vt, temp, 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);
}
break;
}