Chunnel: Adjust z position of vehicles in chunnels to go "under" the water.
This commit is contained in:
@@ -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 */
|
||||
|
Reference in New Issue
Block a user