summaryrefslogtreecommitdiff
path: root/src/newgrf.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-05-06 19:44:22 +0000
committerrubidium <rubidium@openttd.org>2007-05-06 19:44:22 +0000
commitfe1306ce656d9e33fced2b597bc585a61299d932 (patch)
tree8f1d3ee951e23d21c44efd4ddb13d719befd7763 /src/newgrf.cpp
parentba5563b9e8dd42cb4ed44cc5bd0d674fbedc7274 (diff)
downloadopenttd-fe1306ce656d9e33fced2b597bc585a61299d932.tar.xz
(svn r9799) -Codechange: separate engine class and engine running cost class (mart3p).
Diffstat (limited to 'src/newgrf.cpp')
-rw-r--r--src/newgrf.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index 45075b65f..b4f741e87 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -312,7 +312,7 @@ static bool RailVehicleChangeInfo(uint engine, int numinfo, int prop, byte **buf
uint8 tracktype = grf_load_byte(&buf);
switch (tracktype) {
- case 0: rvi[i].railtype = rvi[i].engclass == 2 ? RAILTYPE_ELECTRIC : RAILTYPE_RAIL; break;
+ case 0: rvi[i].railtype = rvi[i].engclass >= 2 ? RAILTYPE_ELECTRIC : RAILTYPE_RAIL; break;
case 1: rvi[i].railtype = RAILTYPE_MONO; break;
case 2: rvi[i].railtype = RAILTYPE_MAGLEV; break;
default:
@@ -456,13 +456,15 @@ static bool RailVehicleChangeInfo(uint engine, int numinfo, int prop, byte **buf
engclass = EC_DIESEL;
} else if (traction <= 0x31) {
engclass = EC_ELECTRIC;
+ } else if (traction <= 0x37) {
+ engclass = EC_MONORAIL;
} else if (traction <= 0x41) {
- engclass = EC_ELECTRIC;
+ engclass = EC_MAGLEV;
} else {
break;
}
- 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;
+ 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;
}
@@ -2986,7 +2988,7 @@ static uint32 GetParamVal(byte param, uint32 *cond_val)
uint major = 2;
uint minor = 6;
uint revision = 0; // special case: 2.0.1 is 2.0.10
- uint build = 1168;
+ uint build = 1210;
return (major << 24) | (minor << 20) | (revision << 16) | build;
}