summaryrefslogtreecommitdiff
path: root/src/newgrf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/newgrf.cpp')
-rw-r--r--src/newgrf.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index 88ebbd3fc..97411ca03 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -447,21 +447,21 @@ static bool RailVehicleChangeInfo(uint engine, int numinfo, int prop, byte **buf
*/
FOR_EACH_OBJECT {
uint8 traction = grf_load_byte(&buf);
- int engclass;
+ EngineClass engclass;
if (traction <= 0x07) {
- engclass = 0;
+ engclass = EC_STEAM;
} else if (traction <= 0x27) {
- engclass = 1;
+ engclass = EC_DIESEL;
} else if (traction <= 0x31) {
- engclass = 2;
+ engclass = EC_ELECTRIC;
} else if (traction <= 0x41) {
- engclass = 2;
+ engclass = EC_ELECTRIC;
} else {
break;
}
- if (rvi[i].railtype == RAILTYPE_RAIL && engclass == 2) rvi[i].railtype = RAILTYPE_ELECTRIC;
- if (rvi[i].railtype == RAILTYPE_ELECTRIC && engclass != 2) rvi[i].railtype = RAILTYPE_RAIL;
+ if (rvi[i].railtype == RAILTYPE_RAIL && engclass == EC_ELECTRIC) rvi[i].railtype = RAILTYPE_ELECTRIC;
+ if (rvi[i].railtype == RAILTYPE_ELECTRIC && engclass != EC_ELECTRIC) rvi[i].railtype = RAILTYPE_RAIL;
rvi[i].engclass = engclass;
}