Fix metadata dupes on maps (#3505)

Fixes https://github.com/space-wizards/RobustToolbox/issues/3504
This commit is contained in:
metalgearsloth
2022-11-20 03:06:32 +11:00
committed by GitHub
parent ec3485e741
commit e0be355707

View File

@@ -915,6 +915,8 @@ public sealed class MapLoaderSystem : EntitySystem
var entities = new SequenceDataNode();
rootNode.Add("entities", entities);
// As metadata isn't on components we'll special-case it.
var metadataName = _factory.GetComponentName(typeof(MetaDataComponent));
var prototypeCompCache = new Dictionary<string, Dictionary<string, MappingDataNode>>();
foreach (var (saveId, entityUid) in uidEntityMap.OrderBy( e=> e.Key))
@@ -941,6 +943,8 @@ public sealed class MapLoaderSystem : EntitySystem
{
cache.Add(compType, _serManager.WriteValueAs<MappingDataNode>(comp.Component.GetType(), comp.Component));
}
cache.GetOrNew(metadataName);
}
}