diff --git a/src/windows/footpath.c b/src/windows/footpath.c index 51309bc1ac..3623eb99c2 100644 --- a/src/windows/footpath.c +++ b/src/windows/footpath.c @@ -430,6 +430,12 @@ static void window_footpath_update_provisional_path_for_bridge_mode(rct_window * if (RCT2_GLOBAL(RCT2_ADDRESS_PATH_CONSTRUCTION_MODE, uint8) != PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL) return; + // Recheck area for construction. Set by ride_construction window + if (RCT2_GLOBAL(RCT2_ADDRESS_PROVISIONAL_PATH_FLAGS, uint8) & (1 << 2)) { + footpath_provisional_remove(); + RCT2_GLOBAL(RCT2_ADDRESS_PROVISIONAL_PATH_FLAGS, uint8) &= ~(1 << 2); + } + // Update provisional bridge mode path if (!(RCT2_GLOBAL(RCT2_ADDRESS_PROVISIONAL_PATH_FLAGS, uint8) & (1 << 1))) { footpath_get_next_path_info(&type, &x, &y, &z, &slope); diff --git a/src/windows/ride_construction.c b/src/windows/ride_construction.c index d81b6e7c0f..c684f60c93 100644 --- a/src/windows/ride_construction.c +++ b/src/windows/ride_construction.c @@ -612,6 +612,8 @@ static void window_ride_construction_mouseup(rct_window *w, int widgetIndex) break; case WIDX_CONSTRUCT: window_ride_construction_construct(w); + // Force any footpath construction to recheck the area. + RCT2_GLOBAL(RCT2_ADDRESS_PROVISIONAL_PATH_FLAGS, uint8) |= (1 << 2); break; case WIDX_DEMOLISH: window_ride_construction_mouseup_demolish(w); @@ -2436,6 +2438,13 @@ void sub_6C94D8() { int x, y, z, direction, type, rideIndex, edxRS16; + // Recheck if area is fine for new track. + // Set by footpath placement + if (_currentTrackSelectionFlags & 8) { + sub_6C9627(); + _currentTrackSelectionFlags &= ~8; + } + switch (_rideConstructionState) { case RIDE_CONSTRUCTION_STATE_FRONT: case RIDE_CONSTRUCTION_STATE_BACK: diff --git a/src/world/footpath.c b/src/world/footpath.c index 943981c9ea..291017e930 100644 --- a/src/world/footpath.c +++ b/src/world/footpath.c @@ -344,6 +344,9 @@ static money32 footpath_place_real(int type, int x, int y, int z, int slope, int return MONEY32_UNDEFINED; } + // Force ride construction to recheck area + RCT2_GLOBAL(0x00F440B0, uint8) |= 8; + footpath_provisional_remove(); mapElement = map_get_footpath_element_slope((x / 32), (y / 32), z, slope); if (mapElement == NULL) {