mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-27 16:54:52 +01:00
Fix #10410: Tile Inspector does not hightlight tile correctly
Mistake made when refactoring not passing the error up through the chain and silently working.
This commit is contained in:
committed by
Michael Steenbeek
parent
0416c2eaa3
commit
e61401e48c
@@ -987,11 +987,11 @@ static void viewport_paint_weather_gloom(rct_drawpixelinfo* dpi)
|
||||
*
|
||||
* rct2: 0x0068958D
|
||||
*/
|
||||
CoordsXY screen_pos_to_map_pos(ScreenCoordsXY screenCoords, int32_t* direction)
|
||||
std::optional<CoordsXY> screen_pos_to_map_pos(ScreenCoordsXY screenCoords, int32_t* direction)
|
||||
{
|
||||
auto mapCoords = screen_get_map_xy(screenCoords, nullptr);
|
||||
if (!mapCoords)
|
||||
return {};
|
||||
return std::nullopt;
|
||||
|
||||
int32_t my_direction;
|
||||
int32_t dist_from_centre_x = abs(mapCoords->x % 32);
|
||||
@@ -1030,7 +1030,7 @@ CoordsXY screen_pos_to_map_pos(ScreenCoordsXY screenCoords, int32_t* direction)
|
||||
|
||||
if (direction != nullptr)
|
||||
*direction = my_direction;
|
||||
return mapCoords->ToTileStart();
|
||||
return { mapCoords->ToTileStart() };
|
||||
}
|
||||
|
||||
ScreenCoordsXY screen_coord_to_viewport_coord(rct_viewport* viewport, ScreenCoordsXY screenCoords)
|
||||
|
||||
Reference in New Issue
Block a user