# HG changeset patch # User celestar # Date 1167581280 0 # Node ID 623bae81fbd265b272b365018f5dff35d250ef36 # Parent 8b68de175f44a9e8d3aa91414c09bda311b9cb68 (svn r7703) [cbh] - Fix: I "optimized" a little too much on previous commit and broke stuff diff -r 8b68de175f44 -r 623bae81fbd2 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;