Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

Commit

Permalink
Stop writing auto visgroups to VMF files
Browse files Browse the repository at this point in the history
  • Loading branch information
LogicAndTrick committed Jul 27, 2014
1 parent 2b4bc3e commit 2ac44fe
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Sledge.Providers/Map/VmfProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ private static GenericStructure WriteEditor(MapObject obj)
{
var editor = new GenericStructure("editor");
editor["color"] = FormatColor(obj.Colour);
foreach (var visgroup in obj.Visgroups.OrderBy(x => x))
foreach (var visgroup in obj.Visgroups.Except(obj.AutoVisgroups).OrderBy(x => x))
{
editor.AddProperty("visgroupid", visgroup.ToString(CultureInfo.InvariantCulture));
}
Expand Down Expand Up @@ -269,7 +269,7 @@ private static Solid ReadSolid(GenericStructure solid, IDGenerator generator)
}

ret.Colour = editor.PropertyColour("color", Colour.GetRandomBrushColour());
ret.Visgroups.AddRange(editor.GetAllPropertyValues("visgroupid").Select(int.Parse));
ret.Visgroups.AddRange(editor.GetAllPropertyValues("visgroupid").Select(int.Parse).Where(x => x > 0));
foreach (var face in ret.Faces)
{
face.Parent = ret;
Expand Down Expand Up @@ -320,7 +320,7 @@ private static Entity ReadEntity(GenericStructure entity, IDGenerator generator)
};
var editor = entity.GetChildren("editor").FirstOrDefault() ?? new GenericStructure("editor");
ret.Colour = editor.PropertyColour("color", Colour.GetRandomBrushColour());
ret.Visgroups.AddRange(editor.GetAllPropertyValues("visgroupid").Select(int.Parse));
ret.Visgroups.AddRange(editor.GetAllPropertyValues("visgroupid").Select(int.Parse).Where(x => x > 0));
foreach (var child in entity.GetChildren("solid").Select(solid => ReadSolid(solid, generator)).Where(s => s != null))
{
child.SetParent(ret, false);
Expand Down Expand Up @@ -353,7 +353,7 @@ private static Group ReadGroup(GenericStructure group, IDGenerator generator)
var g = new Group(GetObjectID(group, generator));
var editor = group.GetChildren("editor").FirstOrDefault() ?? new GenericStructure("editor");
g.Colour = editor.PropertyColour("color", Colour.GetRandomBrushColour());
g.Visgroups.AddRange(editor.GetAllPropertyValues("visgroupid").Select(int.Parse));
g.Visgroups.AddRange(editor.GetAllPropertyValues("visgroupid").Select(int.Parse).Where(x => x > 0));
return g;
}

Expand Down

0 comments on commit 2ac44fe

Please sign in to comment.