content changes for "refactors copy api to use ref" (#10180)
This commit is contained in:
@@ -386,7 +386,7 @@ namespace Content.Server.Disease
|
||||
return;
|
||||
}
|
||||
|
||||
var freshDisease = _serializationManager.CreateCopy(addedDisease);
|
||||
var freshDisease = _serializationManager.Copy(addedDisease);
|
||||
|
||||
if (freshDisease == null) return;
|
||||
|
||||
|
||||
@@ -26,9 +26,9 @@ namespace Content.Server.Jobs
|
||||
var component = (Component) factory.GetComponent(name);
|
||||
component.Owner = mob;
|
||||
|
||||
var copied = (Component?) serializationManager.Copy(data.Component, component, null);
|
||||
if (copied != null)
|
||||
entityManager.AddComponent(mob, copied);
|
||||
var temp = (object) component;
|
||||
serializationManager.Copy(data.Component, ref temp);
|
||||
entityManager.AddComponent(mob, (Component)temp!);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ using Content.Shared.Payload.Components;
|
||||
using Content.Shared.Tag;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.Serialization.Manager;
|
||||
using Robust.Shared.Serialization.Markdown.Validation;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Server.Payload.EntitySystems;
|
||||
@@ -98,8 +99,9 @@ public sealed class PayloadSystem : EntitySystem
|
||||
|
||||
component.Owner = uid;
|
||||
|
||||
if (_serializationManager.Copy(data.Component, component, null) is Component copied)
|
||||
EntityManager.AddComponent(uid, copied);
|
||||
var temp = (object) component;
|
||||
_serializationManager.Copy(data.Component, ref temp);
|
||||
EntityManager.AddComponent(uid, (Component)temp!);
|
||||
|
||||
trigger.GrantedComponents.Add(registration.Type);
|
||||
}
|
||||
|
||||
@@ -59,7 +59,8 @@ namespace Content.Shared.Decals
|
||||
public DecalGridComponent.DecalGridChunkCollection Copy(ISerializationManager serializationManager, DecalGridComponent.DecalGridChunkCollection source,
|
||||
DecalGridComponent.DecalGridChunkCollection target, bool skipHook, ISerializationContext? context = null)
|
||||
{
|
||||
var dict = serializationManager.Copy(source.ChunkCollection, target.ChunkCollection, context, skipHook)!;
|
||||
var dict = target.ChunkCollection;
|
||||
serializationManager.Copy(source.ChunkCollection, ref dict, context, skipHook);
|
||||
return new DecalGridComponent.DecalGridChunkCollection(dict) {NextUid = source.NextUid};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user