Changeset - r15725:0c28e29aa5d4
[Not reviewed]
master
0 7 0
rubidium - 14 years ago 2010-08-07 21:10:57
rubidium@openttd.org
(svn r20402) -Codechange: rename the airport/station class id to something slightly more generic
7 files changed with 13 insertions and 13 deletions:
0 comments (0 inline, 0 general)
src/ai/api/ai_rail.cpp
Show inline comments
 
@@ -175,7 +175,7 @@
 
		if (spec == NULL) {
 
			DEBUG(grf, 1, "%s returned an invalid station ID for 'AI construction/purchase selection (18)' callback", file->filename);
 
		} else {
 
			p2 |= spec->sclass | index << 8;
 
			p2 |= spec->cls_id | index << 8;
 
		}
 

	
 
	}
src/newgrf.cpp
Show inline comments
 
@@ -1151,7 +1151,7 @@ static ChangeInfoResult StationChangeInf
 

	
 
				/* Swap classid because we read it in BE meaning WAYP or DFLT */
 
				uint32 classid = buf->ReadDWord();
 
				(*spec)->sclass = AllocateStationClass(BSWAP32(classid));
 
				(*spec)->cls_id = AllocateStationClass(BSWAP32(classid));
 
				break;
 
			}
 

	
 
@@ -4270,8 +4270,8 @@ static void FeatureNewName(ByteReader *b
 
						if (_cur_grffile->stations == NULL || _cur_grffile->stations[GB(id, 0, 8)] == NULL) {
 
							grfmsg(1, "FeatureNewName: Attempt to name undefined station 0x%X, ignoring", GB(id, 0, 8));
 
						} else {
 
							StationClassID sclass = _cur_grffile->stations[GB(id, 0, 8)]->sclass;
 
							SetStationClassName(sclass, AddGRFString(_cur_grffile->grfid, id, lang, new_scheme, name, STR_UNDEFINED));
 
							StationClassID cls_id = _cur_grffile->stations[GB(id, 0, 8)]->cls_id;
 
							SetStationClassName(cls_id, AddGRFString(_cur_grffile->grfid, id, lang, new_scheme, name, STR_UNDEFINED));
 
						}
 
						break;
 

	
src/newgrf_airport.cpp
Show inline comments
 
@@ -153,8 +153,8 @@ uint GetNumAirportsInClass(AirportClassI
 
 */
 
static void BindAirportSpecToClass(AirportSpec *as)
 
{
 
	assert(as->aclass < APC_MAX);
 
	AirportClass *airport_class = &_airport_classes[as->aclass];
 
	assert(as->cls_id < APC_MAX);
 
	AirportClass *airport_class = &_airport_classes[as->cls_id];
 

	
 
	int i = airport_class->airports++;
 
	airport_class->spec = ReallocT(airport_class->spec, airport_class->airports);
src/newgrf_airport.h
Show inline comments
 
@@ -72,7 +72,7 @@ struct AirportSpec {
 
	Year max_year;                         ///< last year the airport is available
 
	StringID name;                         ///< name of this airport
 
	TTDPAirportType ttd_airport_type;      ///< ttdpatch airport type (Small/Large/Helipad/Oilrig)
 
	AirportClassID aclass;                 ///< the class to which this airport type belongs
 
	AirportClassID cls_id;                 ///< the class to which this airport type belongs
 
	SpriteID preview_sprite;               ///< preview sprite for this airport
 
	/* Newgrf data */
 
	bool enabled;                          ///< entity still avaible (by default true).newgrf can disable it, though
src/newgrf_station.cpp
Show inline comments
 
@@ -176,8 +176,8 @@ void SetCustomStationSpec(StationSpec *s
 
	/* If the station has already been allocated, don't reallocate it. */
 
	if (statspec->allocated) return;
 

	
 
	assert(statspec->sclass < STAT_CLASS_MAX);
 
	station_class = &_station_classes[statspec->sclass];
 
	assert(statspec->cls_id < STAT_CLASS_MAX);
 
	station_class = &_station_classes[statspec->cls_id];
 

	
 
	i = station_class->stations++;
 
	station_class->spec = ReallocT(station_class->spec, station_class->stations);
 
@@ -606,7 +606,7 @@ static const SpriteGroup *StationResolve
 
	uint cargo = 0;
 
	CargoID cargo_type = object->u.station.cargo_type;
 

	
 
	if (bst == NULL || statspec->sclass == STAT_CLASS_WAYP) {
 
	if (bst == NULL || statspec->cls_id == STAT_CLASS_WAYP) {
 
		return group->loading[0];
 
	}
 

	
src/newgrf_station.h
Show inline comments
 
@@ -51,8 +51,8 @@ struct StationSpec {
 

	
 
	bool allocated; ///< Flag whether this station has been added to a station class list
 

	
 
	StationClassID sclass; ///< The class to which this spec belongs.
 
	StringID name; ///< Name of this station.
 
	StationClassID cls_id;    ///< The class to which this spec belongs.
 
	StringID name;            ///< Name of this station.
 

	
 
	/**
 
	 * Bitmask of number of platforms available for the station.
src/station_cmd.cpp
Show inline comments
 
@@ -2801,7 +2801,7 @@ static void GetTileDesc_Station(TileInde
 
		const StationSpec *spec = GetStationSpec(tile);
 

	
 
		if (spec != NULL) {
 
			td->station_class = GetStationClassName(spec->sclass);
 
			td->station_class = GetStationClassName(spec->cls_id);
 
			td->station_name  = spec->name;
 

	
 
			if (spec->grf_prop.grffile != NULL) {
0 comments (0 inline, 0 general)