diff --git a/Source/Core/Windows/LinedefEditForm.cs b/Source/Core/Windows/LinedefEditForm.cs index 8c7e0a8..f2939a1 100644 --- a/Source/Core/Windows/LinedefEditForm.cs +++ b/Source/Core/Windows/LinedefEditForm.cs @@ -482,27 +482,24 @@ namespace CodeImp.DoomBuilder.Windows } // (Re)set hacky flat alignment - if (l.IsFlatAlignment || l.Action == 0) + if (sectortags.ContainsKey(l.Tag)) { - if (sectortags.ContainsKey(l.Tag)) + foreach (Sector s in sectortags[l.Tag]) { - foreach (Sector s in sectortags[l.Tag]) - { - s.UpdateFloorSurface(); - s.UpdateCeilingSurface(); - } + s.UpdateFloorSurface(); + s.UpdateCeilingSurface(); } - if (oldtag != 0 && sectortags.ContainsKey(oldtag)) - { - foreach (Sector s in sectortags[oldtag]) - { - s.UpdateFloorSurface(); - s.UpdateCeilingSurface(); - } - } - l.Front.Sector.UpdateFloorSurface(); - l.Front.Sector.UpdateCeilingSurface(); } + if (sectortags.ContainsKey(oldtag) && oldtag != l.Tag) + { + foreach (Sector s in sectortags[oldtag]) + { + s.UpdateFloorSurface(); + s.UpdateCeilingSurface(); + } + } + l.Front.Sector.UpdateFloorSurface(); + l.Front.Sector.UpdateCeilingSurface(); } // Update the used textures @@ -564,7 +561,24 @@ namespace CodeImp.DoomBuilder.Windows LinedefActionInfo li = General.Map.Config.GetLinedefActionInfo(action.Value); IDictionary newFlags = (li == null || li.Flags.Count == 0) ? General.Map.Config.LinedefFlags : li.Flags; flags.UpdateCheckboxes(newFlags); - } + + // (Re)set hacky flat alignment + foreach (Linedef l in lines) + { + if (l.Tag == 0) + { + l.Front.Sector.UpdateFloorSurface(); + l.Front.Sector.UpdateCeilingSurface(); + } + else + foreach (Sector s in General.Map.Map.Sectors) + if (s.Tag == l.Tag) + { + s.UpdateFloorSurface(); + s.UpdateCeilingSurface(); + } + } + } } // Browse Action clicked @@ -611,6 +625,23 @@ namespace CodeImp.DoomBuilder.Windows l.SetFlag(c.Tag.ToString(), false); } + // (Re)set hacky flat alignment + if (l.IsFlatAlignment) + { + if (l.Tag == 0) + { + l.Front.Sector.UpdateFloorSurface(); + l.Front.Sector.UpdateCeilingSurface(); + } + else + foreach (Sector s in General.Map.Map.Sectors) + if (s.Tag == l.Tag) + { + s.UpdateFloorSurface(); + s.UpdateCeilingSurface(); + } + } + i++; } @@ -824,6 +855,23 @@ namespace CodeImp.DoomBuilder.Windows } } + // (Re)set hacky flat alignment + if (l.IsFlatAlignment && l.IsFlagSet("8192")) + { + if (l.Tag == 0) + { + l.Front.Sector.UpdateFloorSurface(); + l.Front.Sector.UpdateCeilingSurface(); + } + else + foreach (Sector s in General.Map.Map.Sectors) + if (s.Tag == l.Tag) + { + s.UpdateFloorSurface(); + s.UpdateCeilingSurface(); + } + } + i++; }