diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index 84bcb37a23..cc05988d1c 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -1974,7 +1974,7 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi) { // TODO: Make this work with Left/Right park entrance parts int16_t parkEntranceIndex = park_entrance_get_index( - windowTileInspectorToolMap.x, windowTileInspectorToolMap.y, tileElement->GetBaseZ()); + { windowTileInspectorToolMap, tileElement->GetBaseZ() }); gfx_draw_string_left( dpi, STR_TILE_INSPECTOR_ENTRANCE_ENTRANCE_ID, &parkEntranceIndex, COLOUR_WHITE, x, y + 11); } diff --git a/src/openrct2/actions/ParkEntranceRemoveAction.hpp b/src/openrct2/actions/ParkEntranceRemoveAction.hpp index bb12ec4882..341e9fec27 100644 --- a/src/openrct2/actions/ParkEntranceRemoveAction.hpp +++ b/src/openrct2/actions/ParkEntranceRemoveAction.hpp @@ -52,7 +52,7 @@ public: res->Position = _loc; res->ErrorTitle = STR_CANT_REMOVE_THIS; - auto entranceIndex = park_entrance_get_index(_loc.x, _loc.y, _loc.z); + auto entranceIndex = park_entrance_get_index(_loc); if (entranceIndex == -1) { log_error("Could not find entrance at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z); @@ -68,7 +68,7 @@ public: res->Position = _loc; res->ErrorTitle = STR_CANT_REMOVE_THIS; - auto entranceIndex = park_entrance_get_index(_loc.x, _loc.y, _loc.z); + auto entranceIndex = park_entrance_get_index(_loc); if (entranceIndex == -1) { log_error("Could not find entrance at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z); diff --git a/src/openrct2/world/Entrance.cpp b/src/openrct2/world/Entrance.cpp index 35c5cc7455..e5650a8d9b 100644 --- a/src/openrct2/world/Entrance.cpp +++ b/src/openrct2/world/Entrance.cpp @@ -61,12 +61,12 @@ void park_entrance_remove_ghost() } } -int32_t park_entrance_get_index(int32_t x, int32_t y, int32_t z) +int32_t park_entrance_get_index(const CoordsXYZ& entrancePos) { int32_t i = 0; for (const auto& entrance : gParkEntrances) { - if (x == entrance.x && y == entrance.y && z == entrance.z) + if (entrancePos == entrance) { return i; } diff --git a/src/openrct2/world/Park.h b/src/openrct2/world/Park.h index 72d1ca9c8a..dd3e61463f 100644 --- a/src/openrct2/world/Park.h +++ b/src/openrct2/world/Park.h @@ -120,7 +120,7 @@ void update_park_fences_around_tile(CoordsXY coords); uint8_t calculate_guest_initial_happiness(uint8_t percentage); void park_set_open(bool open); -int32_t park_entrance_get_index(int32_t x, int32_t y, int32_t z); +int32_t park_entrance_get_index(const CoordsXYZ& entrancePos); void park_set_entrance_fee(money32 value); money16 park_get_entrance_fee();