Replace IEntityManager resolves in systems for cached EntityManager

This commit is contained in:
Vera Aguilera Puerto
2021-12-08 13:00:43 +01:00
parent 2699540526
commit c8b65be747
98 changed files with 338 additions and 338 deletions

View File

@@ -35,11 +35,11 @@ namespace Content.Server.Projectiles
var otherEntity = args.OtherFixture.Body.Owner;
var coordinates = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(args.OtherFixture.Body.Owner).Coordinates;
var coordinates = EntityManager.GetComponent<TransformComponent>(args.OtherFixture.Body.Owner).Coordinates;
var playerFilter = Filter.Pvs(coordinates);
if (!EntityManager.GetComponent<MetaDataComponent>(otherEntity).EntityDeleted && component.SoundHitSpecies != null &&
IoCManager.Resolve<IEntityManager>().HasComponent<SharedBodyComponent>(otherEntity))
EntityManager.HasComponent<SharedBodyComponent>(otherEntity))
{
SoundSystem.Play(playerFilter, component.SoundHitSpecies.GetSound(), coordinates);
}
@@ -83,7 +83,7 @@ namespace Content.Server.Projectiles
if (component.TimeLeft <= 0)
{
IoCManager.Resolve<IEntityManager>().DeleteEntity(component.Owner);
EntityManager.DeleteEntity(component.Owner);
}
}
}