Chunnel: Adjust z position of vehicles in chunnels to go "under" the water.
This commit is contained in:
@@ -228,17 +228,21 @@ struct GroundVehicle : public SpecializedVehicle<T, Type> {
|
||||
assert(this->z_pos == GetSlopePixelZ(this->x_pos, this->y_pos));
|
||||
}
|
||||
|
||||
void UpdateZPositionInWormhole();
|
||||
|
||||
/**
|
||||
* Checks if the vehicle is in a slope and sets the required flags in that case.
|
||||
* @param new_tile True if the vehicle reached a new tile.
|
||||
* @param update_delta Indicates to also update the delta.
|
||||
* @return Old height of the vehicle.
|
||||
*/
|
||||
inline int UpdateInclination(bool new_tile, bool update_delta)
|
||||
inline int UpdateInclination(bool new_tile, bool update_delta, bool in_wormhole = false)
|
||||
{
|
||||
int old_z = this->z_pos;
|
||||
|
||||
if (new_tile) {
|
||||
if (in_wormhole) {
|
||||
this->UpdateZPositionInWormhole();
|
||||
} else if (new_tile) {
|
||||
this->UpdateZPositionAndInclination();
|
||||
} else {
|
||||
this->UpdateZPosition();
|
||||
|
||||
Reference in New Issue
Block a user