mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-27 08:45:00 +01:00
Refactor the code that uses MapGetFootpathElement
This commit is contained in:
@@ -493,13 +493,12 @@ void FootpathPlaceAction::RemoveIntersectingWalls(PathElement* pathElement) cons
|
||||
WallRemoveIntersectingWalls({ _loc, z, z + (6 * COORDS_Z_STEP) }, DirectionReverse(direction));
|
||||
WallRemoveIntersectingWalls({ _loc, z, z + (6 * COORDS_Z_STEP) }, direction);
|
||||
// Removing walls may have made the pointer invalid, so find it again
|
||||
auto tileElement = MapGetFootpathElement(CoordsXYZ(_loc, z));
|
||||
if (tileElement == nullptr)
|
||||
pathElement = MapGetFootpathElement(CoordsXYZ(_loc, z));
|
||||
if (pathElement == nullptr)
|
||||
{
|
||||
LOG_ERROR("Something went wrong. Could not refind footpath.");
|
||||
return;
|
||||
}
|
||||
pathElement = tileElement->AsPath();
|
||||
}
|
||||
|
||||
if (!(GetFlags() & GAME_COMMAND_FLAG_TRACK_DESIGN))
|
||||
|
||||
Reference in New Issue
Block a user