src/train_cmd.cpp
changeset 7575 0e0efc0fbf2d
parent 7566 435e3c4dbf28
child 7592 48055c5dd43d
--- a/src/train_cmd.cpp	Tue Jun 26 16:58:40 2007 +0000
+++ b/src/train_cmd.cpp	Tue Jun 26 20:03:17 2007 +0000
@@ -2530,14 +2530,14 @@
 static byte AfterSetTrainPos(Vehicle *v, bool new_tile)
 {
 	byte old_z = v->z_pos;
-	v->z_pos= GetSlopeZ(v->x_pos, v->y_pos);
+	v->z_pos = GetSlopeZ(v->x_pos, v->y_pos);
 
 	if (new_tile) {
 		CLRBIT(v->u.rail.flags, VRF_GOINGUP);
 		CLRBIT(v->u.rail.flags, VRF_GOINGDOWN);
 
-		if ((v->u.rail.track == TRACK_X || v->u.rail.track == TRACK_Y)) {
-			/* Any track that isn't TRACK_X or TRACK_Y cannot be sloped.
+		if (v->u.rail.track == TRACK_BIT_X || v->u.rail.track == TRACK_BIT_Y) {
+			/* Any track that isn't TRACK_BIT_X or TRACK_BIT_Y cannot be sloped.
 			 * To check whether the current tile is sloped, and in which
 			 * direction it is sloped, we get the 'z' at the center of
 			 * the tile (middle_z) and the edge of the tile (old_z),
@@ -2549,7 +2549,7 @@
 
 			/* For some reason tunnel tiles are always given as sloped :(
 			 * But they are not sloped... */
-			if (middle_z != old_z && !IsTunnelTile(TileVirtXY(v->x_pos, v->y_pos))) {
+			if (middle_z != v->z_pos && !IsTunnelTile(TileVirtXY(v->x_pos, v->y_pos))) {
 				SETBIT(v->u.rail.flags, (middle_z > old_z) ? VRF_GOINGUP : VRF_GOINGDOWN);
 			}
 		}