diff --git a/src/openrct2/actions/TrackPlaceAction.cpp b/src/openrct2/actions/TrackPlaceAction.cpp index c9960a7f7b..664f709294 100644 --- a/src/openrct2/actions/TrackPlaceAction.cpp +++ b/src/openrct2/actions/TrackPlaceAction.cpp @@ -258,16 +258,6 @@ GameActions::Result TrackPlaceAction::Query() const } costs += canBuild.Cost; - // When building a level crossing, remove any pre-existing path furniture. - if (crossingMode == CREATE_CROSSING_MODE_TRACK_OVER_PATH) - { - auto footpathElement = MapGetFootpathElement(mapLoc); - if (footpathElement != nullptr && footpathElement->AsPath()->HasAddition()) - { - footpathElement->AsPath()->SetAddition(0); - } - } - const auto clearanceData = canBuild.GetData(); uint8_t mapGroundFlags = clearanceData.GroundFlags & (ELEMENT_IS_ABOVE_GROUND | ELEMENT_IS_UNDERGROUND); if (resultData.GroundFlags != 0 && (resultData.GroundFlags & mapGroundFlags) == 0) @@ -478,6 +468,16 @@ GameActions::Result TrackPlaceAction::Execute() const } costs += canBuild.Cost; + // When building a level crossing, remove any pre-existing path furniture. + if (crossingMode == CREATE_CROSSING_MODE_TRACK_OVER_PATH && !(GetFlags() & GAME_COMMAND_FLAG_GHOST)) + { + auto footpathElement = MapGetFootpathElement(mapLoc); + if (footpathElement != nullptr && footpathElement->AsPath()->HasAddition()) + { + footpathElement->AsPath()->SetAddition(0); + } + } + if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST) && !gCheatsDisableClearanceChecks) { FootpathRemoveLitter(mapLoc);