misc client optimizations

This commit is contained in:
Paul
2022-04-18 22:34:49 +02:00
parent dec1495e1e
commit d60bbe9fe9
5 changed files with 43 additions and 15 deletions

View File

@@ -256,8 +256,12 @@ namespace Robust.Shared.Prototypes
MappingDataNode? fullData = null;
if (prototypeData != null && prototypeData.TryGet<SequenceDataNode>("components", out var compList))
{
fullData = compList.Cast<MappingDataNode>().FirstOrDefault(x =>
x.TryGet<ValueDataNode>("type", out var typeNode) && typeNode.Value == name);
foreach (var data in compList)
{
if(data is not MappingDataNode mappingDataNode || !mappingDataNode.TryGet<ValueDataNode>("type", out var typeNode) || typeNode.Value != name ) continue;
fullData = mappingDataNode;
break;
}
}
fullData ??= new MappingDataNode();