From d1194019db7e9834fe03fe5c63b6451a3f7af1fc Mon Sep 17 00:00:00 2001 From: MaxED Date: Sun, 14 Aug 2016 16:59:36 +0000 Subject: [PATCH] Fixed: in some cases dragging lines shorter than 1 mu or vertices belonging to such lines resulted in an infinite loop. --- Source/Core/Map/MapSet.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/Core/Map/MapSet.cs b/Source/Core/Map/MapSet.cs index bba8ab3..94f5040 100644 --- a/Source/Core/Map/MapSet.cs +++ b/Source/Core/Map/MapSet.cs @@ -3042,6 +3042,11 @@ namespace CodeImp.DoomBuilder.Map intersection.x = (float)Math.Round(intersection.x, General.Map.FormatInterface.VertexDecimals); intersection.y = (float)Math.Round(intersection.y, General.Map.FormatInterface.VertexDecimals); + //mxd. Skip when intersection matches start/end position. + // Otherwise infinite ammount of 0-length lines will be created... + if( l1.Start.Position == intersection || l1.End.Position == intersection || + l2.Start.Position == intersection || l2.End.Position == intersection) continue; + //mxd. Do we already have a vertex here? bool existingvert = false; Vertex splitvertex = null;