diff --git a/src/interface/viewport_interaction.c b/src/interface/viewport_interaction.c index 39f1d3bf42..7222302603 100644 --- a/src/interface/viewport_interaction.c +++ b/src/interface/viewport_interaction.c @@ -399,7 +399,7 @@ static void viewport_interaction_remove_footpath(rct_map_element *mapElement, in w = window_find_by_class(WC_FOOTPATH); if (w != NULL) - sub_6A7831(); + footpath_provisional_update(); mapElement2 = map_get_first_element_at(x / 32, y / 32); do { diff --git a/src/windows/footpath.c b/src/windows/footpath.c index ea3567b425..d60ab4d6ed 100644 --- a/src/windows/footpath.c +++ b/src/windows/footpath.c @@ -223,7 +223,7 @@ static void window_footpath_close() window_get_register(w); - sub_6A7831(); + footpath_provisional_update(); viewport_set_visibility(0); map_invalidate_map_selection_tiles(); RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_FLAGS, uint16) &= ~2; @@ -258,7 +258,7 @@ static void window_footpath_mouseup() _window_footpath_cost = MONEY32_UNDEFINED; tool_cancel(); - sub_6A7831(); + footpath_provisional_update(); map_invalidate_map_selection_tiles(); RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_FLAGS, uint16) &= ~2; RCT2_GLOBAL(RCT2_ADDRESS_PATH_CONSTRUCTION_MODE, uint8) = PATH_CONSTRUCTION_MODE_LAND; @@ -273,7 +273,7 @@ static void window_footpath_mouseup() _window_footpath_cost = MONEY32_UNDEFINED; tool_cancel(); - sub_6A7831(); + footpath_provisional_update(); map_invalidate_map_selection_tiles(); RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_FLAGS, uint16) &= ~2; RCT2_GLOBAL(RCT2_ADDRESS_PATH_CONSTRUCTION_MODE, uint8) = PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL_TOOL; @@ -369,7 +369,7 @@ static void window_footpath_dropdown() // Set selected path id RCT2_GLOBAL(RCT2_ADDRESS_SELECTED_PATH_ID, sint16) = pathId; - sub_6A7831(); + footpath_provisional_update(); _window_footpath_cost = MONEY32_UNDEFINED; window_invalidate(w); } @@ -642,7 +642,7 @@ static void window_footpath_show_footpath_types_dialog(rct_window *w, rct_widget */ static void window_footpath_mousedown_direction(int direction) { - sub_6A7831(); + footpath_provisional_update(); RCT2_GLOBAL(RCT2_ADDRESS_CONSTRUCT_PATH_DIRECTION, uint8) = (direction - RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_ROTATION, uint32)) & 3; _window_footpath_cost = MONEY32_UNDEFINED; window_footpath_set_enabled_and_pressed_widgets(); @@ -654,7 +654,7 @@ static void window_footpath_mousedown_direction(int direction) */ static void window_footpath_mousedown_slope(int slope) { - sub_6A7831(); + footpath_provisional_update(); RCT2_GLOBAL(RCT2_ADDRESS_CONSTRUCT_PATH_SLOPE, uint8) = slope; _window_footpath_cost = MONEY32_UNDEFINED; window_footpath_set_enabled_and_pressed_widgets(); @@ -676,7 +676,7 @@ static void window_footpath_set_provisional_path_at_point(int x, int y) if (z == 0) { RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_FLAGS, uint16) &= ~(1 << 0); - sub_6A7831(); + footpath_provisional_update(); } else { // Check for change if ((RCT2_GLOBAL(RCT2_ADDRESS_PROVISIONAL_PATH_FLAGS, uint8) & (1 << 1)) && RCT2_GLOBAL(RCT2_ADDRESS_PROVISIONAL_PATH_X, uint16) == x && RCT2_GLOBAL(RCT2_ADDRESS_PROVISIONAL_PATH_Y, uint16) == y && RCT2_GLOBAL(RCT2_ADDRESS_PROVISIONAL_PATH_Z, uint8) == mapElement->base_height) @@ -690,7 +690,7 @@ static void window_footpath_set_provisional_path_at_point(int x, int y) RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_B_X, uint16) = x; RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_B_Y, uint16) = y; - sub_6A7831(); + footpath_provisional_update(); // Set provisional path slope = RCT2_ADDRESS(0x0098D8B4, uint8)[mapElement->properties.surface.slope & 0x1F]; @@ -715,7 +715,7 @@ static void window_footpath_place_path_at_point(int x, int y) if (RCT2_GLOBAL(RCT2_ADDRESS_PATH_ERROR_OCCURED, uint8) != 0) return; - sub_6A7831(); + footpath_provisional_update(); get_map_coordinates_from_pos(x, y, 0xFFDE, &x, &y, &z, &mapElement); if (z == 0) @@ -895,7 +895,7 @@ static void window_footpath_remove() rct_map_element *mapElement; _window_footpath_cost = MONEY32_UNDEFINED; - sub_6A7831(); + footpath_provisional_update(); mapElement = footpath_get_map_element_to_remove(); if (mapElement != NULL) diff --git a/src/world/footpath.c b/src/world/footpath.c index 869cfe5513..4a6ce75530 100644 --- a/src/world/footpath.c +++ b/src/world/footpath.c @@ -459,7 +459,7 @@ void footpath_provisional_remove() * * rct2: 0x006A7831 */ -void sub_6A7831() +void footpath_provisional_update() { if (RCT2_GLOBAL(RCT2_ADDRESS_PROVISIONAL_PATH_FLAGS, uint8) & PROVISIONAL_PATH_FLAG_SHOW_ARROW) { RCT2_GLOBAL(RCT2_ADDRESS_PROVISIONAL_PATH_FLAGS, uint8) &= ~PROVISIONAL_PATH_FLAG_SHOW_ARROW; diff --git a/src/world/footpath.h b/src/world/footpath.h index 8205b91c47..957c0c7f93 100644 --- a/src/world/footpath.h +++ b/src/world/footpath.h @@ -45,7 +45,7 @@ money32 footpath_place(int type, int x, int y, int z, int slope, int flags); void footpath_remove(int x, int y, int z, int flags); money32 footpath_provisional_set(int type, int x, int y, int z, int slope); void footpath_provisional_remove(); -void sub_6A7831(); +void footpath_provisional_update(); void sub_68A0C9(int screenX, int screenY, int *x, int *y, int *direction, rct_map_element **mapElement); #endif