(svn r1588) -Fix: [ 1105959 ] coded a workaround in the acceleration code so that
authorcelestar
Sat, 22 Jan 2005 18:39:52 +0000
changeset 1087 4cc7a6dd4490
parent 1086 9d00ef71146e
child 1088 3360d6bd5f1e
(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
train_cmd.c
--- a/train_cmd.c	Sat Jan 22 16:24:21 2005 +0000
+++ b/train_cmd.c	Sat Jan 22 18:39:52 2005 +0000
@@ -100,10 +100,12 @@
 		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..