Fixed a bug that could cause a crash when going over the maximum linedef limit

This commit is contained in:
biwa 2021-07-16 17:56:55 +02:00 committed by spherallic
parent b7d92fb704
commit 54fe5ae165
2 changed files with 2 additions and 3 deletions

View file

@ -1398,7 +1398,8 @@ namespace CodeImp.DoomBuilder.Geometry
// Before this point, the new geometry is not linked with the existing geometry.
// Now perform standard geometry stitching to merge the new geometry with the rest
// of the map. The marked vertices indicate the new geometry.
map.StitchGeometry();
if (!map.StitchGeometry())
return false;
map.Update(true, false);
// Find our new lines again, because they have been merged with the other geometry

View file

@ -833,8 +833,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
else
{
// Drawing failed
// NOTE: I have to call this twice, because the first time only cancels this volatile mode
General.Map.UndoRedo.WithdrawUndo();
General.Map.UndoRedo.WithdrawUndo();
}
}