more proper serv4 usage because i forgot to push for the last pr (#12965)

This commit is contained in:
Paul Ritter
2022-12-11 00:25:04 +01:00
committed by GitHub
parent 5715b0c2be
commit bca66488bf
4 changed files with 4 additions and 5 deletions

View File

@@ -384,7 +384,7 @@ namespace Content.Server.Disease
return;
}
var freshDisease = _serializationManager.CreateCopy(addedDisease);
var freshDisease = _serializationManager.CreateCopy(addedDisease, notNullableOverride: true);
if (freshDisease == null) return;

View File

@@ -56,7 +56,7 @@ public sealed class RandomHumanoidSystem : EntitySystem
foreach (var entry in prototype.Components.Values)
{
var comp = (Component) _serialization.CreateCopy(entry.Component);
var comp = (Component) _serialization.CreateCopy(entry.Component, notNullableOverride: true);
comp.Owner = humanoid;
EntityManager.AddComponent(humanoid, comp, true);
}

View File

@@ -1,6 +1,5 @@
using Content.Server.GameTicking;
using Content.Shared.Traits;
using Content.Shared.Whitelist;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.Manager;
@@ -38,7 +37,7 @@ public sealed class TraitSystem : EntitySystem
// Add all components required by the prototype
foreach (var entry in traitPrototype.Components.Values)
{
var comp = (Component) _serializationManager.CreateCopy(entry.Component);
var comp = (Component) _serializationManager.CreateCopy(entry.Component, notNullableOverride: true);
comp.Owner = args.Mob;
EntityManager.AddComponent(args.Mob, comp);
}

View File

@@ -57,7 +57,7 @@ namespace Content.Shared.Decals
bool alwaysWrite = false,
ISerializationContext? context = null)
{
return serializationManager.WriteValue(value.ChunkCollection, alwaysWrite, context);
return serializationManager.WriteValue(value.ChunkCollection, alwaysWrite, context, notNullableOverride: true);
}
}
}