diff options
-rw-r--r-- | src/ground_vehicle.hpp | 2 | ||||
-rw-r--r-- | src/saveload/afterload.cpp | 4 | ||||
-rw-r--r-- | src/tile_type.h | 1 |
3 files changed, 3 insertions, 4 deletions
diff --git a/src/ground_vehicle.hpp b/src/ground_vehicle.hpp index 65c856295..80a88b705 100644 --- a/src/ground_vehicle.hpp +++ b/src/ground_vehicle.hpp @@ -145,7 +145,7 @@ struct GroundVehicle : public SpecializedVehicle<T, Type> { * 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) | HALF_TILE_SIZE, (this->y_pos & ~TILE_UNIT_MASK) | HALF_TILE_SIZE); + int middle_z = GetSlopePixelZ((this->x_pos & ~TILE_UNIT_MASK) | (TILE_SIZE / 2), (this->y_pos & ~TILE_UNIT_MASK) | (TILE_SIZE / 2)); if (middle_z != this->z_pos) { SetBit(this->gv_flags, (middle_z > this->z_pos) ? GVF_GOINGUP_BIT : GVF_GOINGDOWN_BIT); diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index f83979bd4..8a87dcc40 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -458,8 +458,8 @@ static uint FixVehicleInclination(Vehicle *v, Direction dir) byte entry_z = GetSlopePixelZ(entry_x, entry_y); /* Compute middle of the tile. */ - int middle_x = (v->x_pos & ~TILE_UNIT_MASK) + HALF_TILE_SIZE; - int middle_y = (v->y_pos & ~TILE_UNIT_MASK) + HALF_TILE_SIZE; + int middle_x = (v->x_pos & ~TILE_UNIT_MASK) + TILE_SIZE / 2; + int middle_y = (v->y_pos & ~TILE_UNIT_MASK) + TILE_SIZE / 2; byte middle_z = GetSlopePixelZ(middle_x, middle_y); /* middle_z == entry_z, no height change. */ diff --git a/src/tile_type.h b/src/tile_type.h index b43b0e6b5..8a476e980 100644 --- a/src/tile_type.h +++ b/src/tile_type.h @@ -13,7 +13,6 @@ #define TILE_TYPE_H static const uint TILE_SIZE = 16; ///< Tiles are 16x16 "units" in size -static const uint HALF_TILE_SIZE = TILE_SIZE / 2; ///< Half of tile size, to get centre of a tile. static const uint TILE_UNIT_MASK = TILE_SIZE - 1; ///< For masking in/out the inner-tile units. static const uint TILE_PIXELS = 32; ///< a tile is 32x32 pixels static const uint TILE_HEIGHT = 8; ///< The standard height-difference between tiles on two levels is 8 (z-diff 8) |