Merge branch 'custom_bridgeheads' into jgrpp

# Conflicts:
#	src/settings_gui.cpp
#	src/train_cmd.cpp
This commit is contained in:
Jonathan G Rennison
2018-08-05 10:49:02 +01:00

View File

@@ -3847,6 +3847,10 @@ bool TrainController(Train *v, Vehicle *nomove, bool reverse)
goto invalid_rail; goto invalid_rail;
} }
if (old_direction != v->direction) notify_direction_changed(old_direction, v->direction); 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)) { if (!(v->track & TRACK_BIT_WORMHOLE)) {
/* Not inside tunnel */ /* Not inside tunnel */
@@ -4209,6 +4213,7 @@ bool TrainController(Train *v, Vehicle *nomove, bool reverse)
v->x_pos = gp.x; v->x_pos = gp.x;
v->y_pos = gp.y; v->y_pos = gp.y;
v->UpdatePosition(); v->UpdatePosition();
v->UpdateDeltaXY();
if (HasBit(v->gv_flags, GVF_CHUNNEL_BIT)) { if (HasBit(v->gv_flags, GVF_CHUNNEL_BIT)) {
/* update the Z position of the vehicle */ /* update the Z position of the vehicle */
int old_z = v->UpdateInclination(false, false, true); int old_z = v->UpdateInclination(false, false, true);