From 7f74e016693396c076fc3406ae8a9878de87eec0 Mon Sep 17 00:00:00 2001 From: Tulio Leao Date: Thu, 21 Nov 2019 09:22:09 -0300 Subject: [PATCH] Add braces to fix return on null Coords --- src/openrct2-ui/windows/TopToolbar.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index 5c2a738ac0..65c64ea582 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -1379,8 +1379,10 @@ static void sub_6E1F34( auto mapCoords = screen_get_map_xy_quadrant_with_z({ x, y }, z, &cl); if (!mapCoords) + { *grid_x = LOCATION_NULL; return; + } *grid_x = mapCoords->x; *grid_y = mapCoords->y; // If SHIFT pressed @@ -1562,8 +1564,10 @@ static void sub_6E1F34( int16_t z = gSceneryCtrlPressZ; auto mapCoords = screen_get_map_xy_side_with_z({ x, y }, z, &cl); if (!mapCoords) + { *grid_x = LOCATION_NULL; return; + } *grid_x = mapCoords->x; *grid_y = mapCoords->y;