Remove obsolete occurrences of IComponent.Owner being assigned just before AddComponent (#30724)
This commit is contained in:
@@ -36,7 +36,6 @@ public sealed class TwoStageTriggerSystem : EntitySystem
|
||||
if (EntityManager.TryGetComponent(uid, entry.Component.GetType(), out var c))
|
||||
RemComp(uid, c);
|
||||
|
||||
comp.Owner = uid;
|
||||
_serializationManager.CopyTo(entry.Component, ref temp);
|
||||
EntityManager.AddComponent(uid, comp);
|
||||
}
|
||||
|
||||
@@ -51,7 +51,6 @@ public sealed class RandomHumanoidSystem : EntitySystem
|
||||
foreach (var entry in prototype.Components.Values)
|
||||
{
|
||||
var comp = (Component)_serialization.CreateCopy(entry.Component, notNullableOverride: true);
|
||||
comp.Owner = humanoid; // This .owner must survive for now.
|
||||
EntityManager.RemoveComponent(humanoid, comp.GetType());
|
||||
EntityManager.AddComponent(humanoid, comp);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ namespace Content.Server.Jobs
|
||||
foreach (var (name, data) in Components)
|
||||
{
|
||||
var component = (Component) factory.GetComponent(name);
|
||||
component.Owner = mob;
|
||||
|
||||
var temp = (object)component;
|
||||
serializationManager.CopyTo(data.Component, ref temp);
|
||||
|
||||
@@ -54,7 +54,6 @@ public sealed partial class BiomePrototype : IPrototype, IInheritingPrototype
|
||||
foreach (var data in ChunkComponents.Values)
|
||||
{
|
||||
var comp = (Component) serialization.CreateCopy(data.Component, notNullableOverride: true);
|
||||
comp.Owner = target; // look im sorry ok this .owner has to live until engine api exists
|
||||
entityManager.AddComponent(target, comp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,6 @@ public sealed partial class WorldgenConfigPrototype : IPrototype
|
||||
foreach (var data in Components.Values)
|
||||
{
|
||||
var comp = (Component) serialization.CreateCopy(data.Component, notNullableOverride: true);
|
||||
comp.Owner = target; // look im sorry ok this .owner has to live until engine api exists
|
||||
entityManager.AddComponent(target, comp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,7 +183,6 @@ public sealed partial class ArtifactSystem
|
||||
}
|
||||
|
||||
var comp = (Component)_componentFactory.GetComponent(reg);
|
||||
comp.Owner = uid;
|
||||
|
||||
var temp = (object)comp;
|
||||
_serialization.CopyTo(entry.Component, ref temp);
|
||||
@@ -219,7 +218,6 @@ public sealed partial class ArtifactSystem
|
||||
if (entityPrototype?.Components.TryGetComponent(name, out var entry) ?? false)
|
||||
{
|
||||
var comp = (Component)_componentFactory.GetComponent(name);
|
||||
comp.Owner = uid;
|
||||
var temp = (object)comp;
|
||||
_serialization.CopyTo(entry, ref temp);
|
||||
EntityManager.RemoveComponent(uid, temp!.GetType());
|
||||
|
||||
@@ -370,7 +370,6 @@ public abstract class SharedMagicSystem : EntitySystem
|
||||
continue;
|
||||
|
||||
var component = (Component)_compFact.GetComponent(name);
|
||||
component.Owner = ev.Target;
|
||||
var temp = (object)component;
|
||||
_seriMan.CopyTo(data.Component, ref temp);
|
||||
EntityManager.AddComponent(ev.Target, (Component)temp!);
|
||||
|
||||
Reference in New Issue
Block a user