Changed: single-sided linedefs with only back sidedef present are now automatically flipped when loading a map.

Changed, "Flip Linedefs" action: the action will no longer flip single-sided linedefs with only front side.
Fixed a crash when trying to determine sprite angles when images with non-sprite names, starting with expected characters, were present in the Sprites namespace.
This commit is contained in:
MaxED 2016-06-26 22:42:24 +00:00 committed by spherallic
parent 61d3a49dcc
commit 6651a14bc6
3 changed files with 23 additions and 2 deletions

View File

@ -426,6 +426,10 @@ namespace CodeImp.DoomBuilder
//mxd. Sector textures may've been changed
if(nameschanged) data.UpdateUsedTextures();
//mxd. Flip linedefs with only back side
int flipsdone = MapSet.FlipBackwardLinedefs(map.Linedefs);
if(flipsdone > 0) General.WriteLogLine(flipsdone + " single-sided linedefs were flipped.");
// Update structures
options.ApplyGridSettings();
map.UpdateConfiguration();

View File

@ -248,7 +248,7 @@ namespace CodeImp.DoomBuilder.IO
args[2] = GetCollectionEntry(lc, "arg2", false, 0, where);
args[3] = GetCollectionEntry(lc, "arg3", false, 0, where);
args[4] = GetCollectionEntry(lc, "arg4", false, 0, where);
int s1 = GetCollectionEntry(lc, "sidefront", true, -1, where);
int s1 = GetCollectionEntry(lc, "sidefront", false, -1, where);
int s2 = GetCollectionEntry(lc, "sideback", false, -1, where);
//mxd. MoreIDs

View File

@ -1818,6 +1818,23 @@ namespace CodeImp.DoomBuilder.BuilderModes
return;
}
//mxd. Remove single-sided lines with only front side
int selectedcount = selected.Count; // Store initial selection size...
List<Linedef> filtered = new List<Linedef>(selectedcount);
foreach(Linedef l in selected)
{
if(l.Back != null || l.Front == null) filtered.Add(l);
}
selected = filtered;
//mxd. Any valid lines?
if(selected.Count == 0)
{
General.Interface.DisplayStatus(StatusType.Warning, (selectedcount > 1 ? "Selected linedefs already point in the right direction!"
: "Selected linedef already points in the right direction!"));
return;
}
// Make undo
if(selected.Count > 1)
{
@ -1838,7 +1855,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
}
// Remove selection if only one linedef was selected
if(selected.Count == 1)
if(selectedcount == 1)
{
foreach(Linedef ld in selected) ld.Selected = false;
selected.Clear();