1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-20 13:33:02 +01:00

Refactor tile_element_water_height to take CoordsXY

This commit is contained in:
duncanspumpkin
2019-08-13 19:25:39 +01:00
parent 5b92b64ec7
commit f3db7f877a
9 changed files with 16 additions and 20 deletions

View File

@@ -607,18 +607,14 @@ int16_t tile_element_height(const CoordsXY loc)
return height;
}
int16_t tile_element_water_height(int32_t x, int32_t y)
int16_t tile_element_water_height(const CoordsXY loc)
{
// Off the map
if ((unsigned)x >= 8192 || (unsigned)y >= 8192)
if ((unsigned)loc.x >= 8192 || (unsigned)loc.y >= 8192)
return 0;
// Truncate subtile coordinates
int32_t x_tile = x & 0xFFFFFFE0;
int32_t y_tile = y & 0xFFFFFFE0;
// Get the surface element for the tile
auto surfaceElement = map_get_surface_element_at({ x_tile, y_tile });
auto surfaceElement = map_get_surface_element_at(loc);
if (surfaceElement == nullptr)
{