--- a/newgrf.c Fri Nov 17 11:03:38 2006 +0000
+++ b/newgrf.c Fri Nov 17 18:06:40 2006 +0000
@@ -267,7 +267,7 @@
uint8 tracktype = grf_load_byte(&buf);
switch (tracktype) {
- case 0: ei[i].railtype = RAILTYPE_RAIL; break;
+ case 0: ei[i].railtype = rvi[i].engclass == 2 ? RAILTYPE_ELECTRIC : RAILTYPE_RAIL; break;
case 1: ei[i].railtype = RAILTYPE_MONO; break;
case 2: ei[i].railtype = RAILTYPE_MAGLEV; break;
default:
@@ -405,12 +405,13 @@
engclass = 1;
} else if (traction <= 0x31) {
engclass = 2;
- ei[i].railtype = RAILTYPE_ELECTRIC;
} else if (traction <= 0x41) {
engclass = 2;
} else {
break;
}
+ if (ei[i].railtype == RAILTYPE_RAIL && engclass == 2) ei[i].railtype = RAILTYPE_ELECTRIC;
+ if (ei[i].railtype == RAILTYPE_ELECTRIC && engclass != 2) ei[i].railtype = RAILTYPE_RAIL;
rvi[i].engclass = engclass;
}