Inline EntityManager

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 11:11:52 +01:00
parent bd18574412
commit 5e177ae734
108 changed files with 250 additions and 199 deletions

View File

@@ -5,6 +5,7 @@ using Content.Server.Players;
using JetBrains.Annotations;
using Robust.Server.Player;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Utility;
using Robust.Shared.ViewVariables;
@@ -41,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 = Owner.EntityManager.SpawnEntity(Prototype, Owner.Transform.Coordinates);
var mob = IoCManager.Resolve<IEntityManager>().SpawnEntity(Prototype, Owner.Transform.Coordinates);
if (MakeSentient)
MakeSentientCommand.MakeSentient(mob.Uid, Owner.EntityManager);
MakeSentientCommand.MakeSentient(mob.Uid, IoCManager.Resolve<IEntityManager>());
mob.EnsureComponent<MindComponent>();

View File

@@ -4,6 +4,7 @@ using Content.Server.Mind.Components;
using Content.Server.Players;
using Robust.Server.Player;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Utility;
namespace Content.Server.Ghost.Roles.Components
@@ -29,7 +30,7 @@ namespace Content.Server.Ghost.Roles.Components
return false;
if (MakeSentient)
MakeSentientCommand.MakeSentient(OwnerUid, Owner.EntityManager);
MakeSentientCommand.MakeSentient(OwnerUid, IoCManager.Resolve<IEntityManager>());
var ghostRoleSystem = EntitySystem.Get<GhostRoleSystem>();
ghostRoleSystem.GhostRoleInternalCreateMindAndTransfer(session, OwnerUid, OwnerUid, this);