Changeset - r28132:fe2a49779dd8
[Not reviewed]
master
0 5 0
Tyler Trahan - 12 months ago 2023-11-10 22:37:22
tyler@tylertrahan.com
Codechange: Reword rail/road type label constants (#11451)
5 files changed with 17 insertions and 17 deletions:
0 comments (0 inline, 0 general)
src/newgrf.cpp
Show inline comments
 
@@ -1056,9 +1056,9 @@ static ChangeInfoResult RailVehicleChang
 
				}
 

	
 
				switch (tracktype) {
 
					case 0: _gted[e->index].railtypelabel = rvi->engclass >= 2 ? RAILTYPE_ELECTRIC_LABEL : RAILTYPE_RAIL_LABEL; break;
 
					case 1: _gted[e->index].railtypelabel = RAILTYPE_MONO_LABEL; break;
 
					case 2: _gted[e->index].railtypelabel = RAILTYPE_MAGLEV_LABEL; break;
 
					case 0: _gted[e->index].railtypelabel = rvi->engclass >= 2 ? RAILTYPE_LABEL_ELECTRIC : RAILTYPE_LABEL_RAIL; break;
 
					case 1: _gted[e->index].railtypelabel = RAILTYPE_LABEL_MONO; break;
 
					case 2: _gted[e->index].railtypelabel = RAILTYPE_LABEL_MAGLEV; break;
 
					default:
 
						GrfMsg(1, "RailVehicleChangeInfo: Invalid track type {} specified, ignoring", tracktype);
 
						break;
 
@@ -1195,8 +1195,8 @@ static ChangeInfoResult RailVehicleChang
 
				if (_cur.grffile->railtype_list.empty()) {
 
					/* Use traction type to select between normal and electrified
 
					 * rail only when no translation list is in place. */
 
					if (_gted[e->index].railtypelabel == RAILTYPE_RAIL_LABEL     && engclass >= EC_ELECTRIC) _gted[e->index].railtypelabel = RAILTYPE_ELECTRIC_LABEL;
 
					if (_gted[e->index].railtypelabel == RAILTYPE_ELECTRIC_LABEL && engclass  < EC_ELECTRIC) _gted[e->index].railtypelabel = RAILTYPE_RAIL_LABEL;
 
					if (_gted[e->index].railtypelabel == RAILTYPE_LABEL_RAIL     && engclass >= EC_ELECTRIC) _gted[e->index].railtypelabel = RAILTYPE_LABEL_ELECTRIC;
 
					if (_gted[e->index].railtypelabel == RAILTYPE_LABEL_ELECTRIC && engclass  < EC_ELECTRIC) _gted[e->index].railtypelabel = RAILTYPE_LABEL_RAIL;
 
				}
 

	
 
				rvi->engclass = engclass;
src/rail_type.h
Show inline comments
 
@@ -14,10 +14,10 @@
 

	
 
typedef uint32_t RailTypeLabel;
 

	
 
static const RailTypeLabel RAILTYPE_RAIL_LABEL     = 'RAIL';
 
static const RailTypeLabel RAILTYPE_ELECTRIC_LABEL = 'ELRL';
 
static const RailTypeLabel RAILTYPE_MONO_LABEL     = 'MONO';
 
static const RailTypeLabel RAILTYPE_MAGLEV_LABEL   = 'MGLV';
 
static const RailTypeLabel RAILTYPE_LABEL_RAIL     = 'RAIL';
 
static const RailTypeLabel RAILTYPE_LABEL_ELECTRIC = 'ELRL';
 
static const RailTypeLabel RAILTYPE_LABEL_MONO     = 'MONO';
 
static const RailTypeLabel RAILTYPE_LABEL_MAGLEV   = 'MGLV';
 

	
 
/**
 
 * Enumeration for all possible railtypes.
src/road_type.h
Show inline comments
 
@@ -14,8 +14,8 @@
 

	
 
typedef uint32_t RoadTypeLabel;
 

	
 
static const RoadTypeLabel ROADTYPE_ROAD_LABEL = 'ROAD';
 
static const RoadTypeLabel ROADTYPE_TRAM_LABEL = 'ELRL';
 
static const RoadTypeLabel ROADTYPE_LABEL_ROAD = 'ROAD';
 
static const RoadTypeLabel ROADTYPE_LABEL_TRAM = 'ELRL';
 

	
 
/**
 
 * The different roadtypes we support
src/table/railtypes.h
Show inline comments
 
@@ -90,7 +90,7 @@ static const RailTypeInfo _original_rail
 
		0,
 

	
 
		/* rail type label */
 
		RAILTYPE_RAIL_LABEL,
 
		RAILTYPE_LABEL_RAIL,
 

	
 
		/* alternate labels */
 
		RailTypeLabelList(),
 
@@ -191,7 +191,7 @@ static const RailTypeInfo _original_rail
 
		0,
 

	
 
		/* rail type label */
 
		RAILTYPE_ELECTRIC_LABEL,
 
		RAILTYPE_LABEL_ELECTRIC,
 

	
 
		/* alternate labels */
 
		RailTypeLabelList(),
 
@@ -288,7 +288,7 @@ static const RailTypeInfo _original_rail
 
		0,
 

	
 
		/* rail type label */
 
		RAILTYPE_MONO_LABEL,
 
		RAILTYPE_LABEL_MONO,
 

	
 
		/* alternate labels */
 
		RailTypeLabelList(),
 
@@ -385,7 +385,7 @@ static const RailTypeInfo _original_rail
 
		0,
 

	
 
		/* rail type label */
 
		RAILTYPE_MAGLEV_LABEL,
 
		RAILTYPE_LABEL_MAGLEV,
 

	
 
		/* alternate labels */
 
		RailTypeLabelList(),
src/table/roadtypes.h
Show inline comments
 
@@ -73,7 +73,7 @@ static const RoadTypeInfo _original_road
 
		0,
 

	
 
		/* road type label */
 
		ROADTYPE_ROAD_LABEL,
 
		ROADTYPE_LABEL_ROAD,
 

	
 
		/* alternate labels */
 
		RoadTypeLabelList(),
 
@@ -153,7 +153,7 @@ static const RoadTypeInfo _original_road
 
		0,
 

	
 
		/* road type label */
 
		ROADTYPE_TRAM_LABEL,
 
		ROADTYPE_LABEL_TRAM,
 

	
 
		/* alternate labels */
 
		RoadTypeLabelList(),
0 comments (0 inline, 0 general)