Skip to content

Commit

Permalink
Remove setter for Entity.SortedProperties
Browse files Browse the repository at this point in the history
Fixes #27
  • Loading branch information
LogicAndTrick committed Aug 3, 2023
1 parent 8a62a9c commit 4bcca43
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion Sledge.Formats.Map/Formats/JackhamerJmfFormat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ private void BuildTree(MapFile map, IEnumerable<JmfGroup> 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;
Expand Down
4 changes: 2 additions & 2 deletions Sledge.Formats.Map/Formats/VmfObjects/VmfEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ public override MapObject ToMapObject()
var ent = new Entity
{
ClassName = ClassName,
SpawnFlags = SpawnFlags,
SortedProperties = new List<KeyValuePair<string, string>>(Properties)
SpawnFlags = SpawnFlags
};
ent.SortedProperties.AddRange(Properties);

Editor.Apply(ent);

Expand Down
2 changes: 1 addition & 1 deletion Sledge.Formats.Map/Objects/Entity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class Entity : MapObject
{
public string ClassName { get; set; }
public int SpawnFlags { get; set; }
public List<KeyValuePair<string, string>> SortedProperties { get; set; }
public List<KeyValuePair<string, string>> SortedProperties { get; }
public IDictionary<string, string> Properties { get; }

public Entity()
Expand Down

0 comments on commit 4bcca43

Please sign in to comment.