--- a/bridge_cmd.c Sun Dec 31 02:53:23 2006 +0000
+++ b/bridge_cmd.c Sun Dec 31 12:28:51 2006 +0000
@@ -985,12 +985,25 @@
uint32 VehicleEnter_Railway_Bridge(Vehicle *v, TileIndex tile, int x, int y)
{
DiagDirection dir;
+ uint8 dxy;
assert(IsBridgeTile(v->tile));
dir = GetBridgeRampDirection(v->tile);
v->u.rail.track = 0x40;
v->direction = DiagDirToDir(dir);
CLRBIT(v->u.rail.flags, VRF_GOINGUP);
CLRBIT(v->u.rail.flags, VRF_GOINGDOWN);
+
+ switch (dir) {
+ default: NOT_REACHED();
+ case DIAGDIR_NE: dxy = 0xF8; break;
+ case DIAGDIR_SE: dxy = 0x80; break;
+ case DIAGDIR_SW: dxy = 0x08; break;
+ case DIAGDIR_NW: dxy = 0x8F; break;
+ }
+ SB(x, 0, 4, GB(dxy, 4, 4));
+ SB(y, 0, 4, GB(dxy, 0, 4));
+ v->x_pos = x;
+ v->y_pos = y;
return 0;
}