Chunnel: Adjust z position of vehicles in chunnels to go "under" the water.

This commit is contained in:
Jonathan G Rennison
2017-03-05 18:05:04 +00:00
parent 0690dbb8bf
commit ec9f0371e8
4 changed files with 81 additions and 4 deletions

View File

@@ -1685,6 +1685,7 @@ static void UpdateStatusAfterSwap(Train *v)
}
v->UpdatePosition();
if (v->track == TRACK_BIT_WORMHOLE) v->UpdateInclination(false, false, true);
v->UpdateViewport(true, true);
}
@@ -3903,6 +3904,15 @@ bool TrainController(Train *v, Vehicle *nomove, bool reverse)
v->x_pos = gp.x;
v->y_pos = gp.y;
v->UpdatePosition();
if (v->track == TRACK_BIT_WORMHOLE) {
/* update the Z position of the vehicle */
int old_z = v->UpdateInclination(false, false, true);
if (prev == NULL) {
/* This is the first vehicle in the train */
AffectSpeedByZChange(v, old_z);
}
}
if (v->IsDrawn()) v->Vehicle::UpdateViewport(true);
continue;
}
@@ -3919,7 +3929,7 @@ bool TrainController(Train *v, Vehicle *nomove, bool reverse)
}
/* update the Z position of the vehicle */
int old_z = v->UpdateInclination(gp.new_tile != gp.old_tile, false);
int old_z = v->UpdateInclination(gp.new_tile != gp.old_tile, false, v->track == TRACK_BIT_WORMHOLE);
if (prev == NULL) {
/* This is the first vehicle in the train */