From 521e5db4c20bdb26116a47264111c7bbac41e973 Mon Sep 17 00:00:00 2001 From: duncanspumpkin Date: Sat, 21 Dec 2019 12:22:59 +0000 Subject: [PATCH] Make constant values more explicit. Fix mistake in z coordinate conversion --- src/openrct2-ui/interface/ViewportInteraction.cpp | 2 +- src/openrct2-ui/windows/Footpath.cpp | 4 ++-- src/openrct2/world/Footpath.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/openrct2-ui/interface/ViewportInteraction.cpp b/src/openrct2-ui/interface/ViewportInteraction.cpp index 79ad2e548b..7099bf636a 100644 --- a/src/openrct2-ui/interface/ViewportInteraction.cpp +++ b/src/openrct2-ui/interface/ViewportInteraction.cpp @@ -534,7 +534,7 @@ static void viewport_interaction_remove_footpath(TileElement* tileElement, Coord { if (tileElement2->GetType() == TILE_ELEMENT_TYPE_PATH && tileElement2->base_height == z) { - footpath_remove({ mapCoords, z }, GAME_COMMAND_FLAG_APPLY); + footpath_remove({ mapCoords, z * 8 }, GAME_COMMAND_FLAG_APPLY); break; } } while (!(tileElement2++)->IsLastForTile()); diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index ff61b85bdf..46ebbfe30b 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -1002,7 +1002,7 @@ static void window_footpath_construct() // already is lowered if we are building a downwards slope. if (gFootpathConstructSlope == 2) { - gFootpathConstructFromPosition.z += 2 * 8; + gFootpathConstructFromPosition.z += (2 * 8); } } window_footpath_set_enabled_and_pressed_widgets(); @@ -1228,7 +1228,7 @@ static void footpath_get_next_path_info(int32_t* type, CoordsXYZ& footpathLoc, i *slope = gFootpathConstructDirection | TILE_ELEMENT_SLOPE_S_CORNER_UP; if (gFootpathConstructSlope != 2) { - footpathLoc.z -= 2 * 8; + footpathLoc.z -= (2 * 8); *slope ^= TILE_ELEMENT_SLOPE_E_CORNER_UP; } } diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index d2677d70cf..59470aee35 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -190,7 +190,7 @@ money32 footpath_provisional_set(int32_t type, CoordsXYZ footpathLoc, int32_t sl else { // Going up in the world! - virtual_floor_set_height(gFootpathProvisionalPosition.z + 2 * 8); + virtual_floor_set_height(gFootpathProvisionalPosition.z + (2 * 8)); } }