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

@@ -32,7 +32,7 @@ namespace Content.Server.Actions.Actions
foreach (var ent in ents)
{
var ghostBoo = new GhostBooEvent();
ent.EntityManager.EventBus.RaiseLocalEvent(ent.Uid, ghostBoo);
IoCManager.Resolve<IEntityManager>().EventBus.RaiseLocalEvent(ent.Uid, ghostBoo);
if (ghostBoo.Handled)
booCounter++;

View File

@@ -52,7 +52,7 @@ namespace Content.Server.Actions.Spells
}
// TODO: Look this is shitty and ideally a test would do it
var spawnedProto = caster.EntityManager.SpawnEntity(ItemProto, caster.Transform.MapPosition);
var spawnedProto = IoCManager.Resolve<IEntityManager>().SpawnEntity(ItemProto, caster.Transform.MapPosition);
if (!spawnedProto.TryGetComponent(out ItemComponent? itemComponent))
{