diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index f839befcf1..dc52b1fcf6 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -1653,6 +1653,10 @@ void ride_select_next_section() window_ride_construction_update_active_elements(); return; } + + // Invalidate previous track piece (we may not be changing height!) + map_invalidate_virtual_floor_tiles(); + CoordsXYE inputElement, outputElement; inputElement.x = x; inputElement.y = y; @@ -1663,9 +1667,6 @@ void ride_select_next_section() tileElement = outputElement.element; if (!scenery_tool_is_active()) { - // Invalidate previous track piece (we may not be changing height!) - map_invalidate_virtual_floor_tiles(); - // Set next element's height. map_set_virtual_floor_height(tileElement->base_height << 3); } @@ -1717,6 +1718,10 @@ void ride_select_previous_section() window_ride_construction_update_active_elements(); return; } + + // Invalidate previous track piece (we may not be changing height!) + map_invalidate_virtual_floor_tiles(); + track_begin_end trackBeginEnd; if (track_block_get_previous(x, y, tileElement, &trackBeginEnd)) { _currentTrackBeginX = trackBeginEnd.begin_x; @@ -1728,9 +1733,6 @@ void ride_select_previous_section() _rideConstructionArrowPulseTime = 0; if (!scenery_tool_is_active()) { - // Invalidate previous track piece (we may not be changing height!) - map_invalidate_virtual_floor_tiles(); - // Set previous element's height. map_set_virtual_floor_height(trackBeginEnd.begin_element->base_height << 3); } diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index defb235056..4d1b1a3cc4 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -746,11 +746,11 @@ money32 footpath_provisional_set(sint32 type, sint32 x, sint32 y, sint32 z, sint } } + // Invalidate previous footpath piece. + map_invalidate_virtual_floor_tiles(); + if (!scenery_tool_is_active()) { - // Invalidate previous footpath piece. - map_invalidate_virtual_floor_tiles(); - if (cost == MONEY32_UNDEFINED) { // If we can't build this, don't show a virtual floor. diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index 5e03ed3cc6..1c3a4715c4 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -3264,7 +3264,7 @@ sint32 map_can_construct_with_clear_at(sint32 x, sint32 y, sint32 zLow, sint32 z sint32 al, ah, bh, cl, ch, water_height; al = ah = bh = cl = ch = water_height = 0; uint8 slope = 0; - + gMapGroundFlags = ELEMENT_IS_ABOVE_GROUND; bool canBuildCrossing = false; if (x >= gMapSizeUnits || y >= gMapSizeUnits || x < 32 || y < 32) { @@ -4819,11 +4819,6 @@ void map_invalidate_virtual_floor_tiles() } } - // Do not invalidate if we're between ticks. - if (min_position.x == std::numeric_limits::max() || min_position.y == std::numeric_limits::max() || - max_position.x == std::numeric_limits::lowest() || max_position.y == std::numeric_limits::lowest()) - return; - // Apply the virtual floor size to the computed invalidation area. min_position.x -= gMapVirtualFloorBaseSize + 1; min_position.y -= gMapVirtualFloorBaseSize + 1;