From 02cfffcb1e4b4142769cdea0d00ca648975d8d8e Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Wed, 3 Oct 2018 11:07:50 +0200 Subject: [PATCH] Remove some direct usage of TileElement->type --- src/openrct2/world/MapGen.cpp | 4 ++-- src/openrct2/world/TileInspector.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/openrct2/world/MapGen.cpp b/src/openrct2/world/MapGen.cpp index 5260cdfbc1..0aec0eb7a2 100644 --- a/src/openrct2/world/MapGen.cpp +++ b/src/openrct2/world/MapGen.cpp @@ -245,8 +245,8 @@ static void mapgen_place_tree(int32_t type, int32_t x, int32_t y) tileElement = tile_element_insert(x, y, surfaceZ, (1 | 2 | 4 | 8)); assert(tileElement != nullptr); tileElement->clearance_height = surfaceZ + (sceneryEntry->small_scenery.height >> 3); - - tileElement->type = TILE_ELEMENT_TYPE_SMALL_SCENERY | (util_rand() & 3); + tileElement->SetType(TILE_ELEMENT_TYPE_SMALL_SCENERY); + tileElement->SetDirection(util_rand() & 3); SmallSceneryElement* sceneryElement = tileElement->AsSmallScenery(); sceneryElement->SetEntryIndex(type); sceneryElement->SetAge(0); diff --git a/src/openrct2/world/TileInspector.cpp b/src/openrct2/world/TileInspector.cpp index 891d3c2142..c078f027cb 100644 --- a/src/openrct2/world/TileInspector.cpp +++ b/src/openrct2/world/TileInspector.cpp @@ -967,7 +967,7 @@ int32_t tile_inspector_track_set_chain( if (tileElement->AsTrack()->HasChain() != setChain) { - tileElement->type ^= TRACK_ELEMENT_TYPE_FLAG_CHAIN_LIFT; + tileElement->AsTrack()->SetHasChain(setChain); } } }