summaryrefslogtreecommitdiff
path: root/src/elrail.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-07-08 15:10:23 +0000
committerrubidium <rubidium@openttd.org>2008-07-08 15:10:23 +0000
commitd974acac8986accbbbc8c4512ca8e413c9a591f9 (patch)
tree1cb8248688de6895f87895cd745183a1db2c6f56 /src/elrail.cpp
parent03d32e12fba1a4568aee7734d37e7e7195b72e8d (diff)
downloadopenttd-d974acac8986accbbbc8c4512ca8e413c9a591f9.tar.xz
(svn r13681) -Revert (r13678, r13677): the fixes didn't work in all cases (assertions on savegame loads).
-Fix [FS#2102]: but now in a hopefully beter way.
Diffstat (limited to 'src/elrail.cpp')
-rw-r--r--src/elrail.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/elrail.cpp b/src/elrail.cpp
index 11c6f8953..435675b15 100644
--- a/src/elrail.cpp
+++ b/src/elrail.cpp
@@ -495,10 +495,13 @@ int32 SettingsDisableElrail(int32 p1)
}
}
- /* setup total power for trains */
+ /* Fix the total power and acceleration for trains */
FOR_ALL_VEHICLES(v) {
- /* power is cached only for front engines */
- if (v->type == VEH_TRAIN && IsFrontEngine(v)) TrainPowerChanged(v);
+ /* power and acceleration is cached only for front engines */
+ if (v->type == VEH_TRAIN && IsFrontEngine(v)) {
+ TrainPowerChanged(v);
+ UpdateTrainAcceleration(v);
+ }
}
FOR_ALL_PLAYERS(p) p->avail_railtypes = GetPlayerRailtypes(p->index);