1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-16 11:33:03 +01:00

Fix #15096: Crash placing entrance near corner in scenario editor

This commit is contained in:
ζeh Matt
2021-07-27 13:02:34 +03:00
committed by GitHub
parent e9eb1b8304
commit 13aee659f0
2 changed files with 3 additions and 4 deletions

View File

@@ -1412,7 +1412,7 @@ static int32_t footpath_is_connected_to_map_edge_helper(CoordsXYZ footpathPos, i
edges = tileElement->AsPath()->GetEdges();
currentTile.direction = direction_reverse(currentTile.direction);
if (!(flags & FOOTPATH_CONNECTED_MAP_EDGE_IGNORE_NO_ENTRY))
if (!tileElement->IsLastForTile() && !(flags & FOOTPATH_CONNECTED_MAP_EDGE_IGNORE_NO_ENTRY))
{
int elementIndex = 1;
// Loop over all elements and cull appropriate edges
@@ -1422,12 +1422,10 @@ static int32_t footpath_is_connected_to_map_edge_helper(CoordsXYZ footpathPos, i
break;
if (tileElement[elementIndex].GetType() != TILE_ELEMENT_TYPE_BANNER)
{
++elementIndex;
continue;
}
edges &= tileElement[elementIndex].AsBanner()->GetAllowedEdges();
++elementIndex;
} while (!tileElement[elementIndex].IsLastForTile());
} while (!tileElement[elementIndex++].IsLastForTile());
}
// Exclude the direction we came from