Fix incorrect vehicle alignment when entering bridge from W,N directions

This commit is contained in:
Jonathan G Rennison 2018-08-05 10:47:13 +01:00
parent a87720ca06
commit 1b9775479d

View File

@ -3149,6 +3149,10 @@ bool TrainController(Train *v, Vehicle *nomove, bool reverse)
goto invalid_rail;
}
if (old_direction != v->direction) notify_direction_changed(old_direction, v->direction);
DiagDirection dir = GetTunnelBridgeDirection(gp.old_tile);
const byte *b = _initial_tile_subcoord[AxisToTrack(DiagDirToAxis(dir))][dir];
gp.x = (gp.x & ~0xF) | b[0];
gp.y = (gp.y & ~0xF) | b[1];
}
if (!(v->track & TRACK_BIT_WORMHOLE)) {
/* Not inside tunnel */