1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-24 15:24:30 +01:00

fix #2502: Update current pressed footpath direction when camera rotates

This commit is contained in:
IntelOrca
2015-12-19 22:54:15 +00:00
parent 560ec3e647
commit 785d54aa04

View File

@@ -146,8 +146,9 @@ static rct_window_event_list window_footpath_events = {
NULL
};
money32 _window_footpath_cost;
sint8 _window_footpath_provisional_path_arrow_timer;
static money32 _window_footpath_cost;
static sint8 _window_footpath_provisional_path_arrow_timer;
static uint8 _lastUpdatedCameraRotation = UINT8_MAX;
static void window_footpath_mousedown_direction(int direction);
static void window_footpath_mousedown_slope(int slope);
@@ -469,6 +470,13 @@ static void window_footpath_update(rct_window *w)
widget_invalidate(w, WIDX_CONSTRUCT);
window_footpath_update_provisional_path_for_bridge_mode(w);
// #2502: The camera might have changed rotation, so we need to update which directional buttons are pressed
uint8 currentRotation = get_current_rotation();
if (_lastUpdatedCameraRotation != currentRotation) {
_lastUpdatedCameraRotation = currentRotation;
window_footpath_set_enabled_and_pressed_widgets();
}
// Check tool
if (RCT2_GLOBAL(RCT2_ADDRESS_PATH_CONSTRUCTION_MODE, uint8) == PATH_CONSTRUCTION_MODE_LAND) {
if (!(RCT2_GLOBAL(RCT2_ADDRESS_INPUT_FLAGS, uint32) & INPUT_FLAG_TOOL_ACTIVE))