Fixed invalid left/right normal errors during level generation (I think). The voronoi cell generation logic ignored zero-length edges, but it was possible for an edge to be so short that the distance from the adjacent edge to the center of the short edge rounded down to zero in GenerateWallShapes.

This commit is contained in:
Joonas Rikkonen
2018-07-24 15:00:35 +03:00
parent bf0c12ce52
commit e21b756f29
2 changed files with 9 additions and 4 deletions
@@ -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++)
{