From dc054f767b414885a03bac8c3428cc8e013f5934 Mon Sep 17 00:00:00 2001 From: MaxED Date: Thu, 7 Jul 2016 11:20:28 +0000 Subject: [PATCH] On second thought, previous fix should be applied more selectively. --- .../ClassicModes/EditSelectionMode.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Source/Plugins/BuilderModes/ClassicModes/EditSelectionMode.cs b/Source/Plugins/BuilderModes/ClassicModes/EditSelectionMode.cs index 51f8430..e92ec98 100644 --- a/Source/Plugins/BuilderModes/ClassicModes/EditSelectionMode.cs +++ b/Source/Plugins/BuilderModes/ClassicModes/EditSelectionMode.cs @@ -1035,11 +1035,26 @@ namespace CodeImp.DoomBuilder.BuilderModes // This flips all linedefs in the selection (used for mirroring) private void FlipLinedefs() { + //mxd. Check if we need to flip sidedefs + bool flipsides = false; + HashSet selectedlineshash = new HashSet(selectedlines); + foreach(Vertex v in selectedvertices) + { + foreach(Linedef l in v.Linedefs) + { + if(!selectedlineshash.Contains(l)) + { + flipsides = true; + break; + } + } + } + // Flip linedefs foreach(Linedef ld in selectedlines) { ld.FlipVertices(); - ld.FlipSidedefs(); //mxd + if(flipsides) ld.FlipSidedefs(); //mxd } // Done