diff --git a/Barotrauma/BarotraumaShared/Source/Map/Levels/CaveGenerator.cs b/Barotrauma/BarotraumaShared/Source/Map/Levels/CaveGenerator.cs index 1e08742a2..7325965ff 100644 --- a/Barotrauma/BarotraumaShared/Source/Map/Levels/CaveGenerator.cs +++ b/Barotrauma/BarotraumaShared/Source/Map/Levels/CaveGenerator.cs @@ -183,7 +183,7 @@ namespace Barotrauma foreach (GraphEdge ge in graphEdges) { - if (ge.point1 == ge.point2) continue; + if (Vector2.DistanceSquared(ge.point1, ge.point2) < 0.001f) continue; for (int i = 0; i < 2; i++) { diff --git a/Barotrauma/BarotraumaShared/Source/Map/Levels/VoronoiElements.cs b/Barotrauma/BarotraumaShared/Source/Map/Levels/VoronoiElements.cs index 22641dfb4..27ee2e4a7 100644 --- a/Barotrauma/BarotraumaShared/Source/Map/Levels/VoronoiElements.cs +++ b/Barotrauma/BarotraumaShared/Source/Map/Levels/VoronoiElements.cs @@ -211,16 +211,16 @@ namespace Voronoi2 public VoronoiCell AdjacentCell(VoronoiCell cell) { - if (cell1==cell) + if (cell1 == cell) { return cell2; } - else if (cell2==cell) + else if (cell2 == cell) { return cell1; } - return null; + return null; } /// @@ -239,6 +239,11 @@ namespace Voronoi2 return normal; } + + public override string ToString() + { + return "GraphEdge (" + point1.ToString() + ", " + point2.ToString() + ")"; + } } // للترتيب