1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-11 10:02:27 +01:00

Simplified conversions from TileCoordsXYZ to CoordsXY

This commit is contained in:
Tulio Leao
2019-12-19 08:12:42 -03:00
parent 5c657bde9f
commit 7e7b4029a9
2 changed files with 3 additions and 6 deletions

View File

@@ -765,8 +765,7 @@ bool Peep::Place(TileCoordsXYZ location, bool apply)
TileElement* tileElement = reinterpret_cast<TileElement*>(pathElement);
if (!pathElement)
{
tileElement = reinterpret_cast<TileElement*>(
map_get_surface_element_at(TileCoordsXY{ location.x, location.y }.ToCoordsXY()));
tileElement = reinterpret_cast<TileElement*>(map_get_surface_element_at(location.ToCoordsXYZ()));
}
if (!tileElement)

View File

@@ -136,8 +136,7 @@ protected:
static ::testing::AssertionResult AssertIsStartPosition(const char*, const TileCoordsXYZ& location)
{
const uint32_t expectedSurfaceStyle = 11u;
const uint32_t style = map_get_surface_element_at(TileCoordsXY{ location.x, location.y }.ToCoordsXY())
->GetSurfaceStyle();
const uint32_t style = map_get_surface_element_at(location.ToCoordsXYZ())->GetSurfaceStyle();
if (style != expectedSurfaceStyle)
return ::testing::AssertionFailure()
@@ -152,8 +151,7 @@ protected:
{
const uint32_t forbiddenSurfaceStyle = 8u;
const uint32_t style = map_get_surface_element_at(TileCoordsXY{ location.x, location.y }.ToCoordsXY())
->GetSurfaceStyle();
const uint32_t style = map_get_surface_element_at(location.ToCoordsXYZ())->GetSurfaceStyle();
if (style == forbiddenSurfaceStyle)
return ::testing::AssertionFailure()