Fixed: in some cases dragging lines shorter than 1 mu or vertices belonging to such lines resulted in an infinite loop.

This commit is contained in:
MaxED 2016-08-14 16:59:36 +00:00 committed by spherallic
parent 9d5abaf14f
commit d1194019db

View file

@ -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;