1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-24 07:14:31 +01:00

Refactor the code that uses MapGetFootpathElement

This commit is contained in:
ζeh Matt
2023-08-05 18:09:38 +03:00
parent ad2b1959c8
commit 5f515b6a73
7 changed files with 18 additions and 21 deletions

View File

@@ -125,7 +125,8 @@ TileElement* FootpathRemoveAction::GetFootpathElement() const
{
bool getGhostPath = GetFlags() & GAME_COMMAND_FLAG_GHOST;
TileElement* tileElement = MapGetFootpathElement(_loc);
// FIXME: This is a hack to get the footpath element. It should be done in a better way.
TileElement* tileElement = MapGetFootpathElement(_loc)->as<TileElement>();
TileElement* footpathElement = nullptr;
if (tileElement != nullptr)
{