mirror of
https://git.do.srb2.org/STJr/ZoneBuilder.git
synced 2024-11-10 06:41:49 +00:00
Correct sector references when manually flipping sidedefs
This commit is contained in:
parent
ef557fce7f
commit
79dfafc691
2 changed files with 11 additions and 2 deletions
|
@ -1014,7 +1014,9 @@ namespace CodeImp.DoomBuilder.Map
|
|||
}
|
||||
|
||||
// This flips the sidedefs
|
||||
public void FlipSidedefs()
|
||||
public void FlipSidedefs() { FlipSidedefs(false); }
|
||||
|
||||
public void FlipSidedefs(bool flipsectorrefs)
|
||||
{
|
||||
// Flip sidedefs
|
||||
Sidedef oldfront = front;
|
||||
|
@ -1022,6 +1024,13 @@ namespace CodeImp.DoomBuilder.Map
|
|||
AttachFront(oldback);
|
||||
AttachBack(oldfront);
|
||||
|
||||
if (flipsectorrefs & back != null)
|
||||
{
|
||||
Sector old = back.Sector;
|
||||
back.SetSector(front.Sector);
|
||||
front.SetSector(old);
|
||||
}
|
||||
|
||||
General.Map.IsChanged = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -2110,7 +2110,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
// Flip sidedefs in all selected linedefs
|
||||
foreach(Linedef l in validlines)
|
||||
{
|
||||
l.FlipSidedefs();
|
||||
l.FlipSidedefs(true);
|
||||
l.Front.Sector.UpdateNeeded = true;
|
||||
l.Back.Sector.UpdateNeeded = true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue