mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-23 12:22:35 +00:00
@ fixed a bug in the undo/redo system related to removing sectors
This commit is contained in:
parent
129dbf241c
commit
1edd6284bc
2 changed files with 13 additions and 9 deletions
|
@ -348,7 +348,7 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
private void LogRecordInfo(string info)
|
||||
{
|
||||
#if DEBUG
|
||||
//General.WriteLogLine(info);
|
||||
General.WriteLogLine(info);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -138,6 +138,13 @@ namespace CodeImp.DoomBuilder.Map
|
|||
// Already set isdisposed so that changes can be prohibited
|
||||
isdisposed = true;
|
||||
|
||||
// Dispose the sidedefs that are attached to this sector
|
||||
// because a sidedef cannot exist without reference to its sector.
|
||||
if(map.AutoRemove)
|
||||
foreach(Sidedef sd in sidedefs) sd.Dispose();
|
||||
else
|
||||
foreach(Sidedef sd in sidedefs) sd.SetSectorP(null);
|
||||
|
||||
if(map == General.Map.Map)
|
||||
General.Map.UndoRedo.RecRemSector(this);
|
||||
|
||||
|
@ -147,13 +154,6 @@ namespace CodeImp.DoomBuilder.Map
|
|||
// Register the index as free
|
||||
map.AddSectorIndexHole(fixedindex);
|
||||
|
||||
// Dispose the sidedefs that are attached to this sector
|
||||
// because a sidedef cannot exist without reference to its sector.
|
||||
if(map.AutoRemove)
|
||||
foreach(Sidedef sd in sidedefs) sd.Dispose();
|
||||
else
|
||||
foreach(Sidedef sd in sidedefs) sd.SetSectorP(null);
|
||||
|
||||
// Free surface entry
|
||||
General.Map.CRenderer2D.Surfaces.FreeSurfaces(surfaceentry);
|
||||
|
||||
|
@ -180,7 +180,11 @@ namespace CodeImp.DoomBuilder.Map
|
|||
// Serialize / deserialize (passive: this doesn't record)
|
||||
internal void ReadWrite(IReadWriteStream s)
|
||||
{
|
||||
if(!s.IsWriting) BeforePropsChange();
|
||||
if(!s.IsWriting)
|
||||
{
|
||||
BeforePropsChange();
|
||||
updateneeded = true;
|
||||
}
|
||||
|
||||
base.ReadWrite(s);
|
||||
|
||||
|
|
Loading…
Reference in a new issue