summaryrefslogtreecommitdiff
path: root/src/elrail.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/elrail.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/elrail.cpp')
-rw-r--r--src/elrail.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/elrail.cpp b/src/elrail.cpp
index f015f5d51..b208c9e07 100644
--- a/src/elrail.cpp
+++ b/src/elrail.cpp
@@ -406,12 +406,11 @@ int32 SettingsDisableElrail(int32 p1)
/* walk through all train engines */
for (e_id = 0; e_id < NUM_TRAIN_ENGINES; e_id++) {
- const RailVehicleInfo *rv_info = RailVehInfo(e_id);
- Engine *e = GetEngine(e_id);
+ RailVehicleInfo *rv_info = &_rail_vehicle_info[e_id];
/* if it is an electric rail engine and its railtype is the wrong one */
- if (rv_info->engclass == 2 && e->railtype == old_railtype) {
+ if (rv_info->engclass == 2 && rv_info->railtype == old_railtype) {
/* change it to the proper one */
- e->railtype = new_railtype;
+ rv_info->railtype = new_railtype;
}
}