1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-19 21:13:05 +01:00

Replace residual access to path element entry index field

This commit is contained in:
Michael Steenbeek
2018-10-04 15:40:55 +02:00
parent 66cde65f87
commit 0f4560598e
11 changed files with 86 additions and 68 deletions

View File

@@ -370,12 +370,12 @@ static void track_design_save_add_wall(int32_t x, int32_t y, rct_tile_element* t
static void track_design_save_add_footpath(int32_t x, int32_t y, rct_tile_element* tileElement)
{
int32_t entryType = tileElement->properties.path.type >> 4;
int32_t entryType = tileElement->AsPath()->GetEntryIndex();
auto entry = object_entry_get_entry(OBJECT_TYPE_PATHS, entryType);
uint8_t flags = 0;
flags |= tileElement->properties.path.edges & FOOTPATH_PROPERTIES_EDGES_EDGES_MASK;
flags |= (tileElement->properties.path.type & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK) << 5;
flags |= (tileElement->AsPath()->GetSlopeDirection()) << 5;
if (tileElement->AsPath()->IsSloped())
flags |= 0b00010000;
if (tileElement->AsPath()->IsQueue())
@@ -557,13 +557,14 @@ static void track_design_save_remove_wall(int32_t x, int32_t y, rct_tile_element
static void track_design_save_remove_footpath(int32_t x, int32_t y, rct_tile_element* tileElement)
{
int32_t entryType = tileElement->properties.path.type >> 4;
int32_t entryType = tileElement->AsPath()->GetEntryIndex();
auto entry = object_entry_get_entry(OBJECT_TYPE_PATHS, entryType);
uint8_t flags = 0;
flags |= tileElement->properties.path.edges & FOOTPATH_PROPERTIES_EDGES_EDGES_MASK;
flags |= (tileElement->properties.path.type & FOOTPATH_PROPERTIES_FLAG_IS_SLOPED) << 2;
flags |= (tileElement->properties.path.type & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK) << 5;
if (tileElement->AsPath()->IsSloped())
flags |= (1 << 4);
flags |= (tileElement->AsPath()->GetSlopeDirection()) << 5;
if (tileElement->AsPath()->IsQueue())
flags |= (1 << 7);