diff --git a/Sledge.Editor/Actions/MapObjects/Operations/CreateEditDelete.cs b/Sledge.Editor/Actions/MapObjects/Operations/CreateEditDelete.cs index f29edf8d4..215ff763b 100644 --- a/Sledge.Editor/Actions/MapObjects/Operations/CreateEditDelete.cs +++ b/Sledge.Editor/Actions/MapObjects/Operations/CreateEditDelete.cs @@ -204,11 +204,11 @@ public virtual void Perform(Document document) do { // Exclude world objects, but we want to remove Group and (brush) Entity objects as they are invalid if empty. - emptyParents = objects.Where(x => x.Parent != null && !(x.Parent is World) && x.Parent.Children.All(objects.Contains)).ToList(); + emptyParents = objects.Where(x => x.Parent != null && !(x.Parent is World) && x.Parent.Children.All(objects.Contains) && !objects.Contains(x.Parent)).ToList(); foreach (var ep in emptyParents) { // Add the parent object into the delete list - if (!objects.Contains(ep.Parent)) objects.Add(ep.Parent); + objects.Add(ep.Parent); } } while (emptyParents.Any()); // If we changed the collection, we need to re-check