diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index 2f99f75004..e7990aa624 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -2185,7 +2185,7 @@ static void window_tile_inspector_scrollpaint(rct_window* w, rct_drawpixelinfo* const int32_t baseHeight = tileElement->base_height; const int32_t clearanceHeight = tileElement->clearance_height; - const bool ghost = (tileElement->flags & TILE_ELEMENT_FLAG_GHOST) != 0; + const bool ghost = (tileElement->IsGhost()) != 0; const bool broken = (tileElement->flags & TILE_ELEMENT_FLAG_BROKEN) != 0; const bool last = (tileElement->flags & TILE_ELEMENT_FLAG_LAST_TILE) != 0; diff --git a/src/openrct2/actions/MazeSetTrackAction.hpp b/src/openrct2/actions/MazeSetTrackAction.hpp index 272c01e2e5..dce4ea755a 100644 --- a/src/openrct2/actions/MazeSetTrackAction.hpp +++ b/src/openrct2/actions/MazeSetTrackAction.hpp @@ -237,7 +237,7 @@ public: if (flags & GAME_COMMAND_FLAG_GHOST) { - tileElement->flags |= TILE_ELEMENT_FLAG_GHOST; + tileElement->SetGhost(); } map_invalidate_tile_full(flooredX, flooredY); diff --git a/src/openrct2/actions/PlaceParkEntranceAction.hpp b/src/openrct2/actions/PlaceParkEntranceAction.hpp index b49f6c9590..d55e7f6317 100644 --- a/src/openrct2/actions/PlaceParkEntranceAction.hpp +++ b/src/openrct2/actions/PlaceParkEntranceAction.hpp @@ -170,7 +170,7 @@ public: if (flags & GAME_COMMAND_FLAG_GHOST) { - newElement->flags |= TILE_ELEMENT_FLAG_GHOST; + newElement->SetGhost(); } entranceElement->SetDirection(_direction); diff --git a/src/openrct2/actions/TrackPlaceAction.hpp b/src/openrct2/actions/TrackPlaceAction.hpp index a63a23f2a3..bde1f13300 100644 --- a/src/openrct2/actions/TrackPlaceAction.hpp +++ b/src/openrct2/actions/TrackPlaceAction.hpp @@ -616,7 +616,7 @@ public: tileElement->AsTrack()->SetTrackType(_trackType); if (GetFlags() & GAME_COMMAND_FLAG_GHOST) { - tileElement->flags |= TILE_ELEMENT_FLAG_GHOST; + tileElement->SetGhost(); } switch (_trackType) diff --git a/src/openrct2/actions/TrackRemoveAction.hpp b/src/openrct2/actions/TrackRemoveAction.hpp index b051995eac..13c9d2683d 100644 --- a/src/openrct2/actions/TrackRemoveAction.hpp +++ b/src/openrct2/actions/TrackRemoveAction.hpp @@ -442,7 +442,7 @@ public: invalidate_test_results(ride); footpath_queue_chain_reset(); - if (!gCheatsDisableClearanceChecks || !(tileElement->flags & TILE_ELEMENT_FLAG_GHOST)) + if (!gCheatsDisableClearanceChecks || !(tileElement->IsGhost())) { footpath_remove_edges_at(mapLoc.x, mapLoc.y, tileElement); } diff --git a/src/openrct2/paint/VirtualFloor.cpp b/src/openrct2/paint/VirtualFloor.cpp index a4b2c84195..70973d86fb 100644 --- a/src/openrct2/paint/VirtualFloor.cpp +++ b/src/openrct2/paint/VirtualFloor.cpp @@ -277,7 +277,7 @@ static void virtual_floor_get_tile_properties( continue; } - if (tileElement->flags & TILE_ELEMENT_FLAG_GHOST) + if (tileElement->IsGhost()) { *outLit = true; continue; diff --git a/src/openrct2/paint/tile_element/Paint.Banner.cpp b/src/openrct2/paint/tile_element/Paint.Banner.cpp index 964b36631b..263e5497ce 100644 --- a/src/openrct2/paint/tile_element/Paint.Banner.cpp +++ b/src/openrct2/paint/tile_element/Paint.Banner.cpp @@ -60,7 +60,7 @@ void banner_paint(paint_session* session, uint8_t direction, int32_t height, con uint32_t base_id = (direction << 1) + banner_scenery->image; uint32_t image_id = base_id; - if (tile_element->flags & TILE_ELEMENT_FLAG_GHOST) // if being placed + if (tile_element->IsGhost()) // if being placed { session->InteractionType = VIEWPORT_INTERACTION_ITEM_NONE; image_id |= CONSTRUCTION_MARKER; @@ -81,7 +81,7 @@ void banner_paint(paint_session* session, uint8_t direction, int32_t height, con direction = direction_reverse(direction); direction--; // If text not showing / ghost - if (direction >= 2 || (tile_element->flags & TILE_ELEMENT_FLAG_GHOST)) + if (direction >= 2 || (tile_element->IsGhost())) return; uint16_t scrollingMode = banner_scenery->banner.scrolling_mode; diff --git a/src/openrct2/paint/tile_element/Paint.Entrance.cpp b/src/openrct2/paint/tile_element/Paint.Entrance.cpp index 414e2c4f04..bad22f9525 100644 --- a/src/openrct2/paint/tile_element/Paint.Entrance.cpp +++ b/src/openrct2/paint/tile_element/Paint.Entrance.cpp @@ -91,7 +91,7 @@ static void ride_entrance_exit_paint(paint_session* session, uint8_t direction, session->InteractionType = VIEWPORT_INTERACTION_ITEM_RIDE; _unk9E32BC = 0; - if (tile_element->flags & TILE_ELEMENT_FLAG_GHOST) + if (tile_element->IsGhost()) { session->InteractionType = VIEWPORT_INTERACTION_ITEM_NONE; image_id = CONSTRUCTION_MARKER; @@ -157,7 +157,7 @@ static void ride_entrance_exit_paint(paint_session* session, uint8_t direction, paint_util_push_tunnel_left(session, height, TUNNEL_6); } - if (!is_exit && !(tile_element->flags & TILE_ELEMENT_FLAG_GHOST) && tile_element->AsEntrance()->GetRideIndex() != 0xFF + if (!is_exit && !(tile_element->IsGhost()) && tile_element->AsEntrance()->GetRideIndex() != 0xFF && stationObj->ScrollingMode != 0xFF) { set_format_arg(0, uint32_t, 0); @@ -225,7 +225,7 @@ static void park_entrance_paint(paint_session* session, uint8_t direction, int32 session->InteractionType = VIEWPORT_INTERACTION_ITEM_PARK; _unk9E32BC = 0; uint32_t image_id, ghost_id = 0; - if (tile_element->flags & TILE_ELEMENT_FLAG_GHOST) + if (tile_element->IsGhost()) { session->InteractionType = VIEWPORT_INTERACTION_ITEM_NONE; ghost_id = CONSTRUCTION_MARKER; diff --git a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp index 1d84e7c8fd..9915f09fdf 100644 --- a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp +++ b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp @@ -248,7 +248,7 @@ void large_scenery_paint(paint_session* session, uint8_t direction, uint16_t hei image_id |= dword_F4387C; } } - if (tileElement->flags & TILE_ELEMENT_FLAG_GHOST) + if (tileElement->IsGhost()) { session->InteractionType = VIEWPORT_INTERACTION_ITEM_NONE; sequenceNum = CONSTRUCTION_MARKER; diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index a8ecdc9202..b6eeb0b752 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -829,7 +829,7 @@ void path_paint(paint_session* session, uint16_t height, const TileElement* tile sceneryImageFlags = CONSTRUCTION_MARKER; } - if (tile_element->flags & TILE_ELEMENT_FLAG_GHOST) + if (tile_element->IsGhost()) { session->InteractionType = VIEWPORT_INTERACTION_ITEM_NONE; imageFlags = CONSTRUCTION_MARKER; diff --git a/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp b/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp index 57a79d6473..02f53d3ff4 100644 --- a/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp +++ b/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp @@ -53,7 +53,7 @@ void scenery_paint(paint_session* session, uint8_t direction, int32_t height, co baseImageid = SPRITE_ID_PALETTE_COLOUR_1(PALETTE_46); } } - if (tileElement->flags & TILE_ELEMENT_FLAG_GHOST) + if (tileElement->IsGhost()) { session->InteractionType = VIEWPORT_INTERACTION_ITEM_NONE; baseImageid = CONSTRUCTION_MARKER; diff --git a/src/openrct2/paint/tile_element/Paint.Wall.cpp b/src/openrct2/paint/tile_element/Paint.Wall.cpp index 1fc74efc35..aa63cfd1f0 100644 --- a/src/openrct2/paint/tile_element/Paint.Wall.cpp +++ b/src/openrct2/paint/tile_element/Paint.Wall.cpp @@ -198,7 +198,7 @@ void fence_paint(paint_session* session, uint8_t direction, int32_t height, cons } } - if (tile_element->flags & TILE_ELEMENT_FLAG_GHOST) + if (tile_element->IsGhost()) { session->InteractionType = VIEWPORT_INTERACTION_ITEM_NONE; dword_141F710 = CONSTRUCTION_MARKER; diff --git a/src/openrct2/peep/GuestPathfinding.cpp b/src/openrct2/peep/GuestPathfinding.cpp index 763c0f19ef..499cb8cc93 100644 --- a/src/openrct2/peep/GuestPathfinding.cpp +++ b/src/openrct2/peep/GuestPathfinding.cpp @@ -238,7 +238,7 @@ static uint8_t footpath_element_next_in_direction(TileCoordsXYZ loc, TileElement nextTileElement = map_get_first_element_at(loc.x, loc.y); do { - if (nextTileElement->flags & TILE_ELEMENT_FLAG_GHOST) + if (nextTileElement->IsGhost()) continue; if (nextTileElement->GetType() != TILE_ELEMENT_TYPE_PATH) continue; @@ -292,7 +292,7 @@ static uint8_t footpath_element_dest_in_dir( } do { - if (tileElement->flags & TILE_ELEMENT_FLAG_GHOST) + if (tileElement->IsGhost()) continue; switch (tileElement->GetType()) @@ -643,7 +643,7 @@ static void peep_pathfind_heuristic_search( /* Look for all map elements that the peep could walk onto while * navigating to the goal, including the goal tile. */ - if (tileElement->flags & TILE_ELEMENT_FLAG_GHOST) + if (tileElement->IsGhost()) continue; ride_id_t rideIndex = RIDE_ID_NULL; diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index ec04c877a0..ecde010af8 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -3191,7 +3191,7 @@ void rct_peep::PerformNextAction(uint8_t& pathing_result, TileElement*& tile_res continue; if (top_z < tileElement->base_height) continue; - if (tileElement->flags & TILE_ELEMENT_FLAG_GHOST) + if (tileElement->IsGhost()) continue; if (tileElement->GetType() == TILE_ELEMENT_TYPE_PATH) diff --git a/src/openrct2/rct12/RCT12.cpp b/src/openrct2/rct12/RCT12.cpp index 190d00e0ae..03f0bde5b2 100644 --- a/src/openrct2/rct12/RCT12.cpp +++ b/src/openrct2/rct12/RCT12.cpp @@ -31,6 +31,11 @@ bool RCT12TileElementBase::IsLastForTile() const return (this->flags & TILE_ELEMENT_FLAG_LAST_TILE) != 0; } +bool RCT12TileElementBase::IsGhost() const +{ + return (this->flags & TILE_ELEMENT_FLAG_GHOST) != 0; +} + uint8_t RCT12SurfaceElement::GetSlope() const { return (slope & TILE_ELEMENT_SURFACE_SLOPE_MASK); diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 81265b94fd..834051a7f8 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -6512,7 +6512,7 @@ bool ride_has_any_track_elements(const Ride* ride) continue; if (it.element->AsTrack()->GetRideIndex() != ride->id) continue; - if (it.element->flags & TILE_ELEMENT_FLAG_GHOST) + if (it.element->IsGhost()) continue; return true; @@ -6532,7 +6532,7 @@ void ride_all_has_any_track_elements(bool* rideIndexArray) { if (it.element->GetType() != TILE_ELEMENT_TYPE_TRACK) continue; - if (it.element->flags & TILE_ELEMENT_FLAG_GHOST) + if (it.element->IsGhost()) continue; rideIndexArray[it.element->AsTrack()->GetRideIndex()] = true; diff --git a/src/openrct2/ride/Track.cpp b/src/openrct2/ride/Track.cpp index a38528da70..74d3903c0b 100644 --- a/src/openrct2/ride/Track.cpp +++ b/src/openrct2/ride/Track.cpp @@ -1170,7 +1170,7 @@ static money32 track_remove( invalidate_test_results(ride); footpath_queue_chain_reset(); - if (!gCheatsDisableClearanceChecks || !(tileElement->flags & TILE_ELEMENT_FLAG_GHOST)) + if (!gCheatsDisableClearanceChecks || !(tileElement->IsGhost())) { footpath_remove_edges_at(x, y, tileElement); } diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index d077171d6e..f6b93419fd 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -2129,7 +2129,7 @@ static money32 place_maze_design(uint8_t flags, Ride* ride, uint16_t mazeEntry, tileElement->AsTrack()->SetMazeEntry(mazeEntry); if (flags & GAME_COMMAND_FLAG_GHOST) { - tileElement->flags |= TILE_ELEMENT_FLAG_GHOST; + tileElement->SetGhost(); } map_invalidate_element(fx, fy, tileElement); diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index ec1c777c40..183190ce72 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -2199,7 +2199,7 @@ void track_paint(paint_session* session, uint8_t direction, int32_t height, cons session->TrackColours[SCHEME_MISC] = 0x21600000; session->TrackColours[SCHEME_3] = 0x21600000; } - if (tileElement->flags & TILE_ELEMENT_FLAG_GHOST) + if (tileElement->IsGhost()) { uint32_t ghost_id = CONSTRUCTION_MARKER; session->InteractionType = VIEWPORT_INTERACTION_ITEM_NONE; diff --git a/src/openrct2/scenario/Scenario.cpp b/src/openrct2/scenario/Scenario.cpp index 4fe401478b..b2e7578fec 100644 --- a/src/openrct2/scenario/Scenario.cpp +++ b/src/openrct2/scenario/Scenario.cpp @@ -695,7 +695,7 @@ void scenario_fix_ghosts(rct_s6_data* s6) RCT12TileElement* originalElement = reinterpret_cast(map_get_first_element_at(x, y)); do { - if (originalElement->flags & TILE_ELEMENT_FLAG_GHOST) + if (originalElement->IsGhost()) { BannerIndex bannerIndex = tile_element_get_banner_index(reinterpret_cast(originalElement)); if (bannerIndex != BANNER_INDEX_NULL) diff --git a/src/openrct2/world/Banner.cpp b/src/openrct2/world/Banner.cpp index e22ecd38a9..501d28ee1b 100644 --- a/src/openrct2/world/Banner.cpp +++ b/src/openrct2/world/Banner.cpp @@ -254,7 +254,7 @@ static money32 BannerPlace( newTileElement->AsBanner()->SetIndex(*bannerIndex); if (flags & GAME_COMMAND_FLAG_GHOST) { - newTileElement->flags |= TILE_ELEMENT_FLAG_GHOST; + newTileElement->SetGhost(); } map_invalidate_tile_full(x, y); map_animation_create(MAP_ANIMATION_TYPE_BANNER, x, y, newTileElement->base_height); diff --git a/src/openrct2/world/Entrance.cpp b/src/openrct2/world/Entrance.cpp index 4dfab48de0..bbee52f765 100644 --- a/src/openrct2/world/Entrance.cpp +++ b/src/openrct2/world/Entrance.cpp @@ -275,7 +275,7 @@ static money32 RideEntranceExitPlace( if (flags & GAME_COMMAND_FLAG_GHOST) { - tileElement->flags |= TILE_ELEMENT_FLAG_GHOST; + tileElement->SetGhost(); } if (isExit) @@ -370,7 +370,7 @@ static money32 RideEntranceExitRemove(int16_t x, int16_t y, ride_id_t rideIndex, if (tileElement->AsEntrance()->GetStationIndex() != stationNum) continue; - if (flags & GAME_COMMAND_FLAG_5 && !(tileElement->flags & TILE_ELEMENT_FLAG_GHOST)) + if (flags & GAME_COMMAND_FLAG_5 && !(tileElement->IsGhost())) continue; if (tileElement->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_PARK_ENTRANCE) diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index ab7eebcbd3..f35e0dfe0c 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -291,7 +291,7 @@ static money32 footpath_element_insert( tileElement->AsPath()->SetAdditionStatus(255); pathElement->flags &= ~TILE_ELEMENT_FLAG_BROKEN; if (flags & GAME_COMMAND_FLAG_GHOST) - pathElement->flags |= TILE_ELEMENT_FLAG_GHOST; + pathElement->SetGhost(); footpath_queue_chain_reset(); @@ -686,7 +686,7 @@ static money32 footpath_place_from_track( tileElement->AsPath()->SetCorners(0); pathElement->flags &= ~TILE_ELEMENT_FLAG_BROKEN; if (flags & (1 << 6)) - pathElement->flags |= TILE_ELEMENT_FLAG_GHOST; + pathElement->SetGhost(); map_invalidate_tile_full(x, y); } @@ -1061,7 +1061,7 @@ bool fence_in_the_way(int32_t x, int32_t y, int32_t z0, int32_t z1, int32_t dire { if (tileElement->GetType() != TILE_ELEMENT_TYPE_WALL) continue; - if (tileElement->flags & TILE_ELEMENT_FLAG_GHOST) + if (tileElement->IsGhost()) continue; if (z0 >= tileElement->clearance_height) continue; diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index af7b0cace4..f4945644fb 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -283,7 +283,7 @@ TileElement* map_get_path_element_at(int32_t x, int32_t y, int32_t z) // Find the path element at known z do { - if (tileElement->flags & TILE_ELEMENT_FLAG_GHOST) + if (tileElement->IsGhost()) continue; if (tileElement->GetType() != TILE_ELEMENT_TYPE_PATH) continue; @@ -413,7 +413,7 @@ void map_strip_ghost_flag_from_elements() { for (auto& element : gTileElements) { - element.flags &= ~TILE_ELEMENT_FLAG_GHOST; + element.ClearGhost(); } } @@ -821,7 +821,7 @@ void game_command_set_large_scenery_colour( return; } - if ((flags & GAME_COMMAND_FLAG_GHOST) && !(tile_element->flags & TILE_ELEMENT_FLAG_GHOST)) + if ((flags & GAME_COMMAND_FLAG_GHOST) && !(tile_element->IsGhost())) { *ebx = 0; return; @@ -2472,7 +2472,7 @@ void game_command_place_large_scenery( if (flags & GAME_COMMAND_FLAG_GHOST) { - new_tile_element->flags |= TILE_ELEMENT_FLAG_GHOST; + new_tile_element->SetGhost(); } if (tile_num == 0) @@ -2884,8 +2884,7 @@ bool map_can_construct_with_clear_at( { if (tileElement->GetType() != TILE_ELEMENT_TYPE_SURFACE) { - if (zLow < tileElement->clearance_height && zHigh > tileElement->base_height - && !(tileElement->flags & TILE_ELEMENT_FLAG_GHOST)) + if (zLow < tileElement->clearance_height && zHigh > tileElement->base_height && !(tileElement->IsGhost())) { if (tileElement->flags & (bl.GetBaseQuarterOccupied())) { @@ -3372,7 +3371,7 @@ EntranceElement* map_get_park_entrance_element_at(int32_t x, int32_t y, int32_t if (tileElement->AsEntrance()->GetEntranceType() != ENTRANCE_TYPE_PARK_ENTRANCE) continue; - if ((ghost == false) && (tileElement->flags & TILE_ELEMENT_FLAG_GHOST)) + if ((ghost == false) && (tileElement->IsGhost())) continue; return tileElement->AsEntrance(); @@ -3397,7 +3396,7 @@ EntranceElement* map_get_ride_entrance_element_at(int32_t x, int32_t y, int32_t if (tileElement->AsEntrance()->GetEntranceType() != ENTRANCE_TYPE_RIDE_ENTRANCE) continue; - if ((ghost == false) && (tileElement->flags & TILE_ELEMENT_FLAG_GHOST)) + if ((ghost == false) && (tileElement->IsGhost())) continue; return tileElement->AsEntrance(); @@ -3422,7 +3421,7 @@ EntranceElement* map_get_ride_exit_element_at(int32_t x, int32_t y, int32_t z, b if (tileElement->AsEntrance()->GetEntranceType() != ENTRANCE_TYPE_RIDE_EXIT) continue; - if ((ghost == false) && (tileElement->flags & TILE_ELEMENT_FLAG_GHOST)) + if ((ghost == false) && (tileElement->IsGhost())) continue; return tileElement->AsEntrance(); diff --git a/src/openrct2/world/Park.cpp b/src/openrct2/world/Park.cpp index d0e7205b38..e1112e3e86 100644 --- a/src/openrct2/world/Park.cpp +++ b/src/openrct2/world/Park.cpp @@ -183,7 +183,7 @@ void update_park_fences(const CoordsXY coords) if (tileElement->AsEntrance()->GetEntranceType() != ENTRANCE_TYPE_PARK_ENTRANCE) continue; - if (!(tileElement->flags & TILE_ELEMENT_FLAG_GHOST)) + if (!(tileElement->IsGhost())) { fenceRequired = false; break; diff --git a/src/openrct2/world/SmallScenery.cpp b/src/openrct2/world/SmallScenery.cpp index a56eec332d..e4dce67279 100644 --- a/src/openrct2/world/SmallScenery.cpp +++ b/src/openrct2/world/SmallScenery.cpp @@ -49,7 +49,7 @@ static money32 SmallScenerySetColour( return 0; } - if ((flags & GAME_COMMAND_FLAG_GHOST) && !(tileElement->flags & TILE_ELEMENT_FLAG_GHOST)) + if ((flags & GAME_COMMAND_FLAG_GHOST) && !(tileElement->IsGhost())) { return 0; } @@ -317,7 +317,7 @@ static money32 SmallSceneryPlace( if (flags & GAME_COMMAND_FLAG_GHOST) { - newElement->flags |= TILE_ELEMENT_FLAG_GHOST; + newElement->SetGhost(); } map_invalidate_tile_full(x, y); diff --git a/src/openrct2/world/TileElement.cpp b/src/openrct2/world/TileElement.cpp index 582702d792..51d724486c 100644 --- a/src/openrct2/world/TileElement.cpp +++ b/src/openrct2/world/TileElement.cpp @@ -54,6 +54,16 @@ bool TileElementBase::IsGhost() const return (this->flags & TILE_ELEMENT_FLAG_GHOST) != 0; } +void TileElementBase::SetGhost() +{ + this->flags |= TILE_ELEMENT_FLAG_GHOST; +} + +void TileElementBase::ClearGhost() +{ + this->flags &= ~TILE_ELEMENT_FLAG_GHOST; +} + bool tile_element_is_underground(TileElement* tileElement) { do diff --git a/src/openrct2/world/TileElement.h b/src/openrct2/world/TileElement.h index 56641c7560..7fb8ff2081 100644 --- a/src/openrct2/world/TileElement.h +++ b/src/openrct2/world/TileElement.h @@ -71,6 +71,8 @@ struct TileElementBase uint8_t GetDirectionWithOffset(uint8_t offset) const; bool IsLastForTile() const; bool IsGhost() const; + void SetGhost(); + void ClearGhost(); void Remove(); }; diff --git a/src/openrct2/world/Wall.cpp b/src/openrct2/world/Wall.cpp index d009ef5d9b..4c0ac5b8d2 100644 --- a/src/openrct2/world/Wall.cpp +++ b/src/openrct2/world/Wall.cpp @@ -538,7 +538,7 @@ static money32 WallPlace( if (flags & GAME_COMMAND_FLAG_GHOST) { - tileElement->flags |= TILE_ELEMENT_FLAG_GHOST; + tileElement->SetGhost(); } gSceneryTileElement = tileElement; @@ -577,7 +577,7 @@ static money32 WallSetColour( return 0; } - if ((flags & GAME_COMMAND_FLAG_GHOST) && !(wallElement->flags & TILE_ELEMENT_FLAG_GHOST)) + if ((flags & GAME_COMMAND_FLAG_GHOST) && !(wallElement->IsGhost())) { return 0; }