diff --git a/TravelDistanceAnalyzer/src/AdaptiveGridBuilder.cs b/TravelDistanceAnalyzer/src/AdaptiveGridBuilder.cs index ee4a5379..73a1d4ab 100644 --- a/TravelDistanceAnalyzer/src/AdaptiveGridBuilder.cs +++ b/TravelDistanceAnalyzer/src/AdaptiveGridBuilder.cs @@ -30,8 +30,8 @@ public AdaptiveGridBuilder() public AdaptiveGrid Build(IEnumerable corridors, IEnumerable rooms, - IEnumerable? walls = null, - IEnumerable? doors = null) + IEnumerable? walls, + IEnumerable? doors) { foreach (var item in corridors) { @@ -106,6 +106,11 @@ public ulong AddEndPoint(Vector3 exit, double snapDistance) private void AdditionalConnections(GridVertex exit) { + if (!exit.Edges.Any()) + { + throw new Exception("Free vertices should not be present in the grid"); + } + if (exit.Edges.Count > 2) { return;