1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-29 17:54:50 +01:00

Use CoordsXYZ on park_entrance_get_index()

This commit is contained in:
Tulio Leao
2020-01-13 21:21:41 -03:00
parent d34321fdaa
commit 893086440c
4 changed files with 6 additions and 6 deletions

View File

@@ -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);
}

View File

@@ -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);

View File

@@ -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;
}

View File

@@ -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();