summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcelestar <celestar@openttd.org>2005-01-22 18:39:52 +0000
committercelestar <celestar@openttd.org>2005-01-22 18:39:52 +0000
commita81b5187ab33dea4f28aebaa59254f8ae5637218 (patch)
tree036bd44b40960bed4f87f4c94d97db311b139df1
parentd2ea2427deda77fc96f20d26e596c54a0a899552 (diff)
downloadopenttd-a81b5187ab33dea4f28aebaa59254f8ae5637218.tar.xz
(svn r1588) -Fix: [ 1105959 ] coded a workaround in the acceleration code so that
trains don't think they're on a slope while they drive around in a tunnel
-rw-r--r--train_cmd.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/train_cmd.c b/train_cmd.c
index 123911788..ec3c72a2f 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -100,10 +100,12 @@ static int GetRealisticAcceleration(Vehicle *v)
uint mass = rvi->weight + ((_cargoc.weights[u->cargo_type] * u->cargo_count) >> 4);
if (rvi->power) emass += mass;
- if (HASBIT(u->u.rail.flags, VRF_GOINGUP)) {
- f += (float)mass * ( -F_GRAV * F_THETA);
- } else if (HASBIT(u->u.rail.flags, VRF_GOINGDOWN)) {
- f += (float)mass * ( F_GRAV * F_THETA);
+ if (!IsTileType(u->tile, MP_TUNNELBRIDGE)) {
+ if (HASBIT(u->u.rail.flags, VRF_GOINGUP)) {
+ f += (float)mass * ( -F_GRAV * F_THETA);
+ } else if (HASBIT(u->u.rail.flags, VRF_GOINGDOWN)) {
+ f += (float)mass * ( F_GRAV * F_THETA);
+ }
}
// compute curve penalty..