mirror of
https://git.do.srb2.org/STJr/ZoneBuilder.git
synced 2024-11-10 06:41:49 +00:00
Unfreeze arrays when stitching geometry fails
This commit is contained in:
parent
28aa7e4481
commit
2f407b585c
1 changed files with 18 additions and 4 deletions
|
@ -2103,23 +2103,37 @@ namespace CodeImp.DoomBuilder.Map
|
||||||
|
|
||||||
// Split moving lines with unselected vertices
|
// Split moving lines with unselected vertices
|
||||||
ICollection<Vertex> nearbyfixedverts = FilterByArea(fixedverts, ref editarea);
|
ICollection<Vertex> nearbyfixedverts = FilterByArea(fixedverts, ref editarea);
|
||||||
if(!SplitLinesByVertices(movinglines, nearbyfixedverts, STITCH_DISTANCE, movinglines, mergemode))
|
if (!SplitLinesByVertices(movinglines, nearbyfixedverts, STITCH_DISTANCE, movinglines, mergemode))
|
||||||
|
{
|
||||||
|
EndAddRemove(); // Unfreeze arrays before returning
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Split non-moving lines with selected vertices
|
// Split non-moving lines with selected vertices
|
||||||
fixedlines = FilterByArea(fixedlines, ref editarea);
|
fixedlines = FilterByArea(fixedlines, ref editarea);
|
||||||
fixedlines = new HashSet<Linedef>(fixedlines.Where(fixedline => !fixedline.IsDisposed));
|
fixedlines = new HashSet<Linedef>(fixedlines.Where(fixedline => !fixedline.IsDisposed));
|
||||||
if(!SplitLinesByVertices(fixedlines, movingverts, STITCH_DISTANCE, movinglines, mergemode))
|
if (!SplitLinesByVertices(fixedlines, movingverts, STITCH_DISTANCE, movinglines, mergemode))
|
||||||
|
{
|
||||||
|
EndAddRemove(); // Unfreeze arrays before returning
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//mxd. Split moving lines with fixed lines
|
//mxd. Split moving lines with fixed lines
|
||||||
if(!SplitLinesByLines(fixedlines, movinglines, mergemode)) return false;
|
if (!SplitLinesByLines(fixedlines, movinglines, mergemode))
|
||||||
|
{
|
||||||
|
EndAddRemove(); // Unfreeze arrays before returning
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Remove looped linedefs
|
// Remove looped linedefs
|
||||||
RemoveLoopedLinedefs(movinglines);
|
RemoveLoopedLinedefs(movinglines);
|
||||||
|
|
||||||
// Join overlapping lines
|
// Join overlapping lines
|
||||||
if(!JoinOverlappingLines(movinglines)) return false;
|
if (!JoinOverlappingLines(movinglines))
|
||||||
|
{
|
||||||
|
EndAddRemove(); // Unfreeze arrays before returning
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//mxd. Remove remaining new verts from dragged shape if possible
|
//mxd. Remove remaining new verts from dragged shape if possible
|
||||||
if(mergemode == MergeGeometryMode.REPLACE)
|
if(mergemode == MergeGeometryMode.REPLACE)
|
||||||
|
|
Loading…
Reference in a new issue