Fixed a bug where flipping a line resulted in a crash, if its start vertex did not belong to any other line

This commit is contained in:
boris_i 2009-06-28 14:47:21 +00:00
parent a42d9143e0
commit 6eb77d0bc0

View file

@ -547,12 +547,18 @@ namespace CodeImp.DoomBuilder.Map
// This flips the linedef's vertex attachments // This flips the linedef's vertex attachments
public void FlipVertices() public void FlipVertices()
{ {
// make sure the start/end vertices are not automatically
// deleted if they do not belong to any other line
General.Map.Map.AutoRemove = false;
// Flip vertices // Flip vertices
Vertex oldstart = start; Vertex oldstart = start;
Vertex oldend = end; Vertex oldend = end;
SetStartVertex(oldend); SetStartVertex(oldend);
SetEndVertex(oldstart); SetEndVertex(oldstart);
General.Map.Map.AutoRemove = true;
// For drawing, the interior now lies on the other side // For drawing, the interior now lies on the other side
frontinterior = !frontinterior; frontinterior = !frontinterior;