summaryrefslogtreecommitdiff
path: root/src/newgrf.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-05-06 15:01:44 +0000
committerrubidium <rubidium@openttd.org>2007-05-06 15:01:44 +0000
commit5c0a52149d5124b6c68d698dba4807b832339cf2 (patch)
treedcf6bc8598cc98dbb7b1444a65d5dcefeced2f1c /src/newgrf.cpp
parentabbaa1691e1900870740b5878dd95b5bef7a0cf0 (diff)
downloadopenttd-5c0a52149d5124b6c68d698dba4807b832339cf2.tar.xz
(svn r9795) -Codechange: enumify the EngineClass.
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;
}