summaryrefslogtreecommitdiff
path: root/src/openttd.cpp
diff options
context:
space:
mode:
authortron <tron@openttd.org>2007-01-24 07:14:09 +0000
committertron <tron@openttd.org>2007-01-24 07:14:09 +0000
commit0996de79df839647968838498d1953319705606d (patch)
treee2918d49dec3bdc87eab67e767fcb414e9cc04c2 /src/openttd.cpp
parente2f72cbf1ff97f1b0eab68614ac730fe8cd47b73 (diff)
downloadopenttd-0996de79df839647968838498d1953319705606d.tar.xz
(svn r8385) -Fix
-Regression (r8314): I only did half the necessary changes to move railtype from Engine to RailVehicleInfo. Now do the rest.
Diffstat (limited to 'src/openttd.cpp')
-rw-r--r--src/openttd.cpp11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp
index 33595d885..1a85591d8 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -1413,20 +1413,11 @@ bool AfterLoadGame(void)
/* Elrails got added in rev 24 */
if (CheckSavegameVersion(24)) {
Vehicle *v;
- uint i;
RailType min_rail = RAILTYPE_ELECTRIC;
- for (i = 0; i < lengthof(_engines); i++) {
- Engine *e = GetEngine(i);
- if (e->type == VEH_Train &&
- (e->railtype != RAILTYPE_RAIL || RailVehInfo(i)->engclass == 2)) {
- e->railtype++;
- }
- }
-
FOR_ALL_VEHICLES(v) {
if (v->type == VEH_Train) {
- RailType rt = GetEngine(v->engine_type)->railtype;
+ RailType rt = RailVehInfo(v->engine_type)->railtype;
v->u.rail.railtype = rt;
if (rt == RAILTYPE_ELECTRIC) min_rail = RAILTYPE_RAIL;