From c36606c051d358b169fac030d35934f8e5451a79 Mon Sep 17 00:00:00 2001 From: Tulio Leao Date: Wed, 13 Nov 2019 08:44:26 -0300 Subject: [PATCH] Distinguish Screen and Map Coords on window_rotate_camera --- src/openrct2/interface/Window.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index 3049365c75..5282d653eb 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -922,21 +922,20 @@ void window_rotate_camera(rct_window* w, int32_t direction) // x is LOCATION_NULL if middle of viewport is obstructed by another window? if (coords.x == LOCATION_NULL || other != viewport) { - coords.x = (viewport->view_width >> 1) + viewport->view_x; - coords.y = (viewport->view_height >> 1) + viewport->view_y; + x = (viewport->view_width >> 1) + viewport->view_x; + y = (viewport->view_height >> 1) + viewport->view_y; viewport_adjust_for_map_height(&x, &y, &z); - coords = { x, y }; } else { - z = tile_element_height({ coords.x, coords.y }); + z = tile_element_height(coords); } gCurrentRotation = (get_current_rotation() + direction) & 3; int32_t new_x, new_y; - centre_2d_coordinates(coords.x, coords.y, z, &new_x, &new_y, viewport); + centre_2d_coordinates(x, y, z, &new_x, &new_y, viewport); w->saved_view_x = new_x; w->saved_view_y = new_y;