diff --git a/Sledge.Formats.Map/Formats/JackhamerJmfFormat.cs b/Sledge.Formats.Map/Formats/JackhamerJmfFormat.cs index 18a360e..0bbe436 100644 --- a/Sledge.Formats.Map/Formats/JackhamerJmfFormat.cs +++ b/Sledge.Formats.Map/Formats/JackhamerJmfFormat.cs @@ -67,7 +67,9 @@ private void BuildTree(MapFile map, IEnumerable groups, IReadOnlyColle var worldspawnEntity = entities.FirstOrDefault(x => x.Entity.ClassName == "worldspawn"); if (worldspawnEntity != null) { - map.Worldspawn.SortedProperties = worldspawnEntity.Entity.SortedProperties; + var props = worldspawnEntity.Entity.SortedProperties.ToList(); + map.Worldspawn.SortedProperties.Clear(); + map.Worldspawn.SortedProperties.AddRange(props); map.Worldspawn.Color = worldspawnEntity.Entity.Color; map.Worldspawn.SpawnFlags = worldspawnEntity.Entity.SpawnFlags; map.Worldspawn.Visgroups = worldspawnEntity.Entity.Visgroups; diff --git a/Sledge.Formats.Map/Formats/VmfObjects/VmfEntity.cs b/Sledge.Formats.Map/Formats/VmfObjects/VmfEntity.cs index 27a412a..3036ca8 100644 --- a/Sledge.Formats.Map/Formats/VmfObjects/VmfEntity.cs +++ b/Sledge.Formats.Map/Formats/VmfObjects/VmfEntity.cs @@ -51,9 +51,9 @@ public override MapObject ToMapObject() var ent = new Entity { ClassName = ClassName, - SpawnFlags = SpawnFlags, - SortedProperties = new List>(Properties) + SpawnFlags = SpawnFlags }; + ent.SortedProperties.AddRange(Properties); Editor.Apply(ent); diff --git a/Sledge.Formats.Map/Objects/Entity.cs b/Sledge.Formats.Map/Objects/Entity.cs index aafd56e..37ad723 100644 --- a/Sledge.Formats.Map/Objects/Entity.cs +++ b/Sledge.Formats.Map/Objects/Entity.cs @@ -9,7 +9,7 @@ public class Entity : MapObject { public string ClassName { get; set; } public int SpawnFlags { get; set; } - public List> SortedProperties { get; set; } + public List> SortedProperties { get; } public IDictionary Properties { get; } public Entity()