Use IDynamicTypeFactory instead of new T() in SharedMechanismComponent.cs
This commit is contained in:
@@ -158,8 +158,7 @@ namespace Content.Shared.GameObjects.Components.Body.Mechanism
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
behavior = new T();
|
behavior = IoCManager.Resolve<IDynamicTypeFactory>().CreateInstance<T>();
|
||||||
IoCManager.InjectDependencies(behavior);
|
|
||||||
_behaviors.Add(typeof(T), behavior);
|
_behaviors.Add(typeof(T), behavior);
|
||||||
behavior.Initialize(this);
|
behavior.Initialize(this);
|
||||||
behavior.Startup();
|
behavior.Startup();
|
||||||
|
|||||||
Reference in New Issue
Block a user