(svn r7703) [cbh] - Fix: I "optimized" a little too much on previous commit and broke stuff custombridgeheads
authorcelestar
Sun, 31 Dec 2006 16:08:00 +0000
branchcustombridgeheads
changeset 5614 623bae81fbd2
parent 5613 8b68de175f44
child 5615 d6197e6c420e
(svn r7703) [cbh] - Fix: I "optimized" a little too much on previous commit and broke stuff
train_cmd.c
--- a/train_cmd.c	Sun Dec 31 16:03:49 2006 +0000
+++ b/train_cmd.c	Sun Dec 31 16:08:00 2006 +0000
@@ -3020,7 +3020,7 @@
   * assumes the train is on a bridge head about to enter
   * the bridge.
   */
-static void PutTrainOntoBridge(Vehicle *v)
+static void PutTrainOntoBridge(Vehicle *v, int x, int y)
 {
 	DiagDirection dir;
 	uint8 dxy;
@@ -3038,8 +3038,10 @@
 		case DIAGDIR_SW: dxy = 0x08; break;
 		case DIAGDIR_NW: dxy = 0x8F; break;
 	}
-	SB(v->x_pos, 0, 4, GB(dxy, 4, 4));
-	SB(v->y_pos, 0, 4, GB(dxy, 0, 4));
+	SB(x, 0, 4, GB(dxy, 4, 4));
+	SB(y, 0, 4, GB(dxy, 0, 4));
+	v->x_pos = x;
+	v->y_pos = y;
 }
 
 static void TrainController(Vehicle *v, bool update_image)
@@ -3105,7 +3107,7 @@
 				 * to enter the tile that is under bridge. Enter the bridge wormhole instead. */
 				if (IsBridgeTile(gp.old_tile) && GetBridgeRampDirection(gp.old_tile) == enterdir) {
 					/* train entering the bridge body */
-					PutTrainOntoBridge(v);
+					PutTrainOntoBridge(v, gp.x, gp.y);
 					UpdateTrainDeltaXY(v, v->direction);
 					if (update_image) v->cur_image = GetTrainImage(v, v->direction);
 					continue;