Replace IEntityManager resolves in systems for cached EntityManager
This commit is contained in:
@@ -61,7 +61,7 @@ namespace Content.Server.Flash
|
||||
return;
|
||||
}
|
||||
|
||||
if (IoCManager.Resolve<IEntityManager>().HasComponent<FlashableComponent>(args.Entity))
|
||||
if (EntityManager.HasComponent<FlashableComponent>(args.Entity))
|
||||
{
|
||||
args.CanInteract = true;
|
||||
Flash(args.Entity, args.User, uid, comp.FlashDuration, comp.SlowTo);
|
||||
@@ -75,7 +75,7 @@ namespace Content.Server.Flash
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var entity in _entityLookup.GetEntitiesInRange(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(comp.Owner).Coordinates, comp.Range))
|
||||
foreach (var entity in _entityLookup.GetEntitiesInRange(EntityManager.GetComponent<TransformComponent>(comp.Owner).Coordinates, comp.Range))
|
||||
{
|
||||
Flash(entity, args.User, uid, comp.AoeFlashDuration, comp.SlowTo);
|
||||
}
|
||||
@@ -86,7 +86,7 @@ namespace Content.Server.Flash
|
||||
if (comp.HasUses)
|
||||
{
|
||||
// TODO flash visualizer
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent<SpriteComponent?>(comp.Owner, out var sprite))
|
||||
if (!EntityManager.TryGetComponent<SpriteComponent?>(comp.Owner, out var sprite))
|
||||
return false;
|
||||
|
||||
if (--comp.Uses == 0)
|
||||
@@ -149,7 +149,7 @@ namespace Content.Server.Flash
|
||||
|
||||
foreach (var entity in _entityLookup.GetEntitiesInRange(transform.Coordinates, range))
|
||||
{
|
||||
if (!IoCManager.Resolve<IEntityManager>().HasComponent<FlashableComponent>(entity) ||
|
||||
if (!EntityManager.HasComponent<FlashableComponent>(entity) ||
|
||||
!transform.InRangeUnobstructed(entity, range, CollisionGroup.Opaque)) continue;
|
||||
|
||||
Flash(entity, user, source, duration, slowTo, displayPopup);
|
||||
|
||||
Reference in New Issue
Block a user