Bunch more resolves removed.

This commit is contained in:
Vera Aguilera Puerto
2021-12-08 17:17:12 +01:00
parent ba736f70df
commit 684cb76173
38 changed files with 267 additions and 208 deletions

View File

@@ -16,6 +16,8 @@ namespace Content.Server.Ghost.Roles.Components
[RegisterComponent, ComponentReference(typeof(GhostRoleComponent))]
public class GhostRoleMobSpawnerComponent : GhostRoleComponent
{
[Dependency] private readonly IEntityManager _entMan = default!;
public override string Name => "GhostRoleMobSpawner";
[ViewVariables(VVAccess.ReadWrite)] [DataField("deleteOnSpawn")]
@@ -40,10 +42,10 @@ namespace Content.Server.Ghost.Roles.Components
if (string.IsNullOrEmpty(Prototype))
throw new NullReferenceException("Prototype string cannot be null or empty!");
var mob = IoCManager.Resolve<IEntityManager>().SpawnEntity(Prototype, IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner).Coordinates);
var mob = _entMan.SpawnEntity(Prototype, _entMan.GetComponent<TransformComponent>(Owner).Coordinates);
if (MakeSentient)
MakeSentientCommand.MakeSentient(mob, IoCManager.Resolve<IEntityManager>());
MakeSentientCommand.MakeSentient(mob, _entMan);
mob.EnsureComponent<MindComponent>();
@@ -56,7 +58,7 @@ namespace Content.Server.Ghost.Roles.Components
Taken = true;
if (_deleteOnSpawn)
IoCManager.Resolve<IEntityManager>().DeleteEntity(Owner);
_entMan.DeleteEntity(Owner);
return true;
}