CompFactory updates (#37559)
This commit is contained in:
@@ -43,7 +43,6 @@ namespace Content.Shared.Magic;
|
||||
public abstract class SharedMagicSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly ISerializationManager _seriMan = default!;
|
||||
[Dependency] private readonly IComponentFactory _compFact = default!;
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
[Dependency] private readonly SharedMapSystem _mapSystem = default!;
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
@@ -356,7 +355,7 @@ public abstract class SharedMagicSystem : EntitySystem
|
||||
if (HasComp(target, data.Component.GetType()))
|
||||
continue;
|
||||
|
||||
var component = (Component)_compFact.GetComponent(name);
|
||||
var component = (Component)Factory.GetComponent(name);
|
||||
var temp = (object)component;
|
||||
_seriMan.CopyTo(data.Component, ref temp);
|
||||
EntityManager.AddComponent(target, (Component)temp!);
|
||||
@@ -367,7 +366,7 @@ public abstract class SharedMagicSystem : EntitySystem
|
||||
{
|
||||
foreach (var toRemove in comps)
|
||||
{
|
||||
if (_compFact.TryGetRegistration(toRemove, out var registration))
|
||||
if (Factory.TryGetRegistration(toRemove, out var registration))
|
||||
RemComp(target, registration.Type);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user