File diff r11916:e3a8d08bf479 → r11917:612c11f7ab47
src/strings.cpp
Show inline comments
 
@@ -662,13 +662,13 @@ static char *FormatString(char *buff, co
 
			case SCC_STATION_FEATURES: { // {STATIONFEATURES}
 
				buff = StationGetSpecialString(buff, GetInt32(&argv), last);
 
				break;
 
			}
 

	
 
			case SCC_INDUSTRY_NAME: { // {INDUSTRY}
 
				const Industry *i = GetIndustry(GetInt32(&argv));
 
				const Industry *i = Industry::Get(GetInt32(&argv));
 
				int64 args[2];
 

	
 
				/* industry not valid anymore? */
 
				if (!i->IsValid()) break;
 

	
 
				/* First print the town name and the industry type name. */
 
@@ -824,13 +824,13 @@ static char *FormatString(char *buff, co
 

	
 
			case SCC_CURRENCY: // {CURRENCY}
 
				buff = FormatGenericCurrency(buff, _currency, GetInt64(&argv), false, last);
 
				break;
 

	
 
			case SCC_WAYPOINT_NAME: { // {WAYPOINT}
 
				Waypoint *wp = GetWaypoint(GetInt32(&argv));
 
				Waypoint *wp = Waypoint::Get(GetInt32(&argv));
 

	
 
				assert(wp->IsValid());
 

	
 
				if (wp->name != NULL) {
 
					buff = strecpy(buff, wp->name, last);
 
				} else {
 
@@ -852,13 +852,13 @@ static char *FormatString(char *buff, co
 
					 * be "drawing" an invalid station is in the case of cargo that is
 
					 * in transit. */
 
					buff = GetStringWithArgs(buff, STR_UNKNOWN_STATION, NULL, last);
 
					break;
 
				}
 

	
 
				const Station *st = GetStation(sid);
 
				const Station *st = Station::Get(sid);
 
				if (st->name != NULL) {
 
					buff = strecpy(buff, st->name, last);
 
				} else {
 
					StringID str = st->string_id;
 
					if (st->indtype != IT_INVALID) {
 
						/* Special case where the industry provides the name for the station */
 
@@ -879,13 +879,13 @@ static char *FormatString(char *buff, co
 
					buff = GetStringWithArgs(buff, str, temp, last);
 
				}
 
				break;
 
			}
 

	
 
			case SCC_TOWN_NAME: { // {TOWN}
 
				const Town *t = GetTown(GetInt32(&argv));
 
				const Town *t = Town::Get(GetInt32(&argv));
 
				int64 temp[1];
 

	
 
				assert(t->IsValid());
 

	
 
				temp[0] = t->townnameparts;
 
				uint32 grfid = t->townnamegrfid;
 
@@ -906,13 +906,13 @@ static char *FormatString(char *buff, co
 
					}
 
				}
 
				break;
 
			}
 

	
 
			case SCC_GROUP_NAME: { // {GROUP}
 
				const Group *g = GetGroup(GetInt32(&argv));
 
				const Group *g = Group::Get(GetInt32(&argv));
 

	
 
				assert(g->IsValid());
 

	
 
				if (g->name != NULL) {
 
					buff = strecpy(buff, g->name, last);
 
				} else {
 
@@ -923,24 +923,24 @@ static char *FormatString(char *buff, co
 
				}
 
				break;
 
			}
 

	
 
			case SCC_ENGINE_NAME: { // {ENGINE}
 
				EngineID engine = (EngineID)GetInt32(&argv);
 
				const Engine *e = GetEngine(engine);
 
				const Engine *e = Engine::Get(engine);
 

	
 
				if (e->name != NULL) {
 
					buff = strecpy(buff, e->name, last);
 
				} else {
 
					buff = GetStringWithArgs(buff, e->info.string_id, NULL, last);
 
				}
 
				break;
 
			}
 

	
 
			case SCC_VEHICLE_NAME: { // {VEHICLE}
 
				const Vehicle *v = GetVehicle(GetInt32(&argv));
 
				const Vehicle *v = Vehicle::Get(GetInt32(&argv));
 

	
 
				if (v->name != NULL) {
 
					buff = strecpy(buff, v->name, last);
 
				} else {
 
					int64 args[1];
 
					args[0] = v->unitnumber;
 
@@ -957,23 +957,23 @@ static char *FormatString(char *buff, co
 
					buff = GetStringWithArgs(buff, str, args, last);
 
				}
 
				break;
 
			}
 

	
 
			case SCC_SIGN_NAME: { // {SIGN}
 
				const Sign *si = GetSign(GetInt32(&argv));
 
				const Sign *si = Sign::Get(GetInt32(&argv));
 
				if (si->name != NULL) {
 
					buff = strecpy(buff, si->name, last);
 
				} else {
 
					buff = GetStringWithArgs(buff, STR_SIGN_DEFAULT, NULL, last);
 
				}
 
				break;
 
			}
 

	
 
			case SCC_COMPANY_NAME: { // {COMPANY}
 
				const Company *c = GetCompany((CompanyID)GetInt32(&argv));
 
				const Company *c = Company::Get((CompanyID)GetInt32(&argv));
 

	
 
				if (c->name != NULL) {
 
					buff = strecpy(buff, c->name, last);
 
				} else {
 
					int64 args[1];
 
					args[0] = c->name_2;
 
@@ -992,13 +992,13 @@ static char *FormatString(char *buff, co
 
					buff = GetStringWithArgs(buff, STR_COMPANY_NUM, args, last);
 
				}
 
				break;
 
			}
 

	
 
			case SCC_PRESIDENT_NAME: { // {PRESIDENTNAME}
 
				const Company *c = GetCompany((CompanyID)GetInt32(&argv));
 
				const Company *c = Company::Get((CompanyID)GetInt32(&argv));
 

	
 
				if (c->president_name != NULL) {
 
					buff = strecpy(buff, c->president_name, last);
 
				} else {
 
					int64 args[1];
 
					args[0] = c->president_name_2;