diff --git a/src/ground_vehicle.hpp b/src/ground_vehicle.hpp --- a/src/ground_vehicle.hpp +++ b/src/ground_vehicle.hpp @@ -134,7 +134,7 @@ struct GroundVehicle : public Specialize */ inline void UpdateZPositionAndInclination() { - this->z_pos = GetSlopePixelZ(this->x_pos, this->y_pos); + this->z_pos = GetSlopePixelZ(this->x_pos, this->y_pos, true); ClrBit(this->gv_flags, GVF_GOINGUP_BIT); ClrBit(this->gv_flags, GVF_GOINGDOWN_BIT); @@ -143,7 +143,7 @@ struct GroundVehicle : public Specialize * direction it is sloped, we get the 'z' at the center of * the tile (middle_z) and the edge of the tile (old_z), * which we then can compare. */ - int middle_z = GetSlopePixelZ((this->x_pos & ~TILE_UNIT_MASK) | (TILE_SIZE / 2), (this->y_pos & ~TILE_UNIT_MASK) | (TILE_SIZE / 2)); + int middle_z = GetSlopePixelZ((this->x_pos & ~TILE_UNIT_MASK) | (TILE_SIZE / 2), (this->y_pos & ~TILE_UNIT_MASK) | (TILE_SIZE / 2), true); if (middle_z != this->z_pos) { SetBit(this->gv_flags, (middle_z > this->z_pos) ? GVF_GOINGUP_BIT : GVF_GOINGDOWN_BIT); @@ -200,7 +200,7 @@ struct GroundVehicle : public Specialize if (HasBit(this->gv_flags, GVF_GOINGUP_BIT) || HasBit(this->gv_flags, GVF_GOINGDOWN_BIT)) { if (T::From(this)->HasToUseGetSlopePixelZ()) { /* In some cases, we have to use GetSlopePixelZ() */ - this->z_pos = GetSlopePixelZ(this->x_pos, this->y_pos); + this->z_pos = GetSlopePixelZ(this->x_pos, this->y_pos, true); return; } /* DirToDiagDir() is a simple right shift */ @@ -220,7 +220,7 @@ struct GroundVehicle : public Specialize this->z_pos += HasBit(this->gv_flags, GVF_GOINGUP_BIT) ? d : -d; } - assert(this->z_pos == GetSlopePixelZ(this->x_pos, this->y_pos)); + assert(this->z_pos == GetSlopePixelZ(this->x_pos, this->y_pos, true)); } /**