mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-02-17 01:22:18 +00:00
Make Sector modes now corrects linedefs when they only have a back side
This commit is contained in:
parent
dd973ef0cb
commit
c64106d52a
1 changed files with 17 additions and 2 deletions
|
@ -233,14 +233,29 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
General.Interface.SetCursor(Cursors.WaitCursor);
|
||||
General.Settings.FindDefaultDrawSettings();
|
||||
General.Map.UndoRedo.CreateUndo("Make Sector");
|
||||
|
||||
|
||||
// Mark the lines we are going to use for this sector
|
||||
General.Map.Map.ClearAllMarks(true);
|
||||
foreach(LinedefSide ls in allsides) ls.Line.Marked = false;
|
||||
List<Linedef> oldlines = General.Map.Map.GetMarkedLinedefs(true);
|
||||
|
||||
|
||||
// Make the sector
|
||||
Sector s = Tools.MakeSector(allsides, oldlines);
|
||||
|
||||
// Now we go for all the lines along the sector to
|
||||
// see if they only have a back side. In that case we want
|
||||
// to flip the linedef to that it only has a front side.
|
||||
foreach(Sidedef sd in s.Sidedefs)
|
||||
{
|
||||
if((sd.Line.Front == null) && (sd.Line.Back != null))
|
||||
{
|
||||
// Flip linedef
|
||||
sd.Line.FlipVertices();
|
||||
sd.Line.FlipSidedefs();
|
||||
}
|
||||
}
|
||||
|
||||
General.Map.Data.UpdateUsedTextures();
|
||||
General.Interface.SetCursor(Cursors.Default);
|
||||
return s;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue